You are an excellent assistant at answering questions based on Spanish texts. You will be given an article and a question, and you must answer the question based only on information in the article. The response should be extracted from the context verbatim.

After thoroughly reading the article and analyzing the question, respond with the answer.

Title:
Islamism

Context:
After al-Nimeiry was overthrown in 1985 the party did poorly in national elections, but in 1989 it was able to overthrow the elected post-al-Nimeiry government with the help of the military. Turabi was noted for proclaiming his support for the democratic process and a liberal government before coming to power, but strict application of sharia law, torture and mass imprisonment of the opposition, and an intensification of the long-running war in southern Sudan, once in power. The NIF regime also harbored Osama bin Laden for a time (before 9/11), and worked to unify Islamist opposition to the American attack on Iraq in the 1991 Gulf War.

Question:
How did the party overthrow the elected government in 1989?

with the help of the military