Governing party leader Recep Tayyip Erdogan won a seat in parliament by a huge margin Sunday, a crucial victory that opens the way for him to become prime minister and strengthens his hand in uniting a government divided on allowing in U.S. troops for an Iraq war.

The charismatic Erdogan -- already the nation's de facto leader -- has advocated the U.S. troop deployment in Turkey, and analysts say one of his first moves as premier could be to purge ministers who oppose it.

Prime Minister Abdullah Gul is expected to resign Wednesday to make way for Erdogan to take over the government, after Erdogan's Justice and Development Party overwhelmingly won by-election balloting in the southern town of Siirt. Gov. Nuri Okutan of Siirt said Justice captured 84.7 percent of the vote. Justice is likely to have won all three seats that were contested Sunday.

It was unclear when parliament would be ready to take up a new resolution on U.S. troop deployment, after lawmakers failed to approve a resolution March 1.

Turkish media say a vote could come as early as Thursday, but members of the Justice Party said it might be two weeks before a new government is in place.

When asked when a new resolution would be introduced, Erdogan said, "We have the U.N. Security Council before us, we have the process of forming a new government. We need to assess all these very carefully, and then we will take a decision."

U.S. diplomats have said Washington will seek a Tuesday or Wednesday council vote on an ultimatum giving Iraq until March 17 to disarm or face war. France opposes such a resolution and many council members have expressed reservations.

"The expected coalition is not there and the lack of it is threatening the process," Erdogan said, when asked about the possibility of war. "I still haven't lost hope for peace, even if it's a thousand to one chance."

He also said he "most certainly" would shuffle the Cabinet but he gave no details.

Erdogan's election was likely to end some of the confusion within the Turkish government. Gul is head of the administration, but Erdogan leads the ruling party and is widely regarded as the power behind the scenes. It was Erdogan whom President Bush invited to the White House after Turkey's national elections in November.

Some analysts say those muddled lines of authority contributed to the failure of the deployment resolution by a mere four votes in the 550-seat parliament -- despite Justice's huge majority of 362 seats.

Erdogan had been barred from running in November national elections because of a conviction for inciting religious hatred over a poem he read at a 1998 rally in Siirt, 60 miles north of the Iraqi border.

Justice lawmakers changed the constitution after the national vote to allow Erdogan to run for office Sunday.

"In the November elections, the person who was the prime minister in our hearts was not able to become a deputy. This week this mistake, this shame is being rectified," said Deputy Prime Minister Ertugrul Yalcinbayir.

The vote comes as Washington pressures Turkey to base U.S. combat troops to open a northern front against neighboring Iraq in a possible war. Ships carrying equipment for the soldiers are already off the Turkish coast, and it was unclear how long Washington could wait for a Turkish decision. Some equipment already has been unloaded and moved to a temporary staging area in southeastern Turkey not far from the border.

Erdogan has hinted he will soon resubmit a troop deployment motion. Although the Turkish public is overwhelmingly against a war, Erdogan urged legislators after the failed vote to act "not to satisfy their daily emotions but toward the country's future."

Rebuffing the United States risks straining ties with Washington and losing a say in the future of neighboring Iraq -- as well as a $15 billion U.S. aid package offered in exchange for hosting U.S. troops.

"Recep Tayyip Erdogan's test in Siirt will determine the fate of the motion," Enis Berberoglu wrote in the Hurriyet newspaper. "If a result that pleases the [Justice party] emerges from the elections, then Erdogan's hand will be strengthened."

The newspaper reported Saturday that Erdogan plans to sack four ministers who opposed the deployment, reducing the number of ministers from 24 to 20.

During Gul's premiership, Erdogan strongly influenced policy, and Cabinet ministers -- including Gul -- often consulted Erdogan after key meetings.

Although Erdogan urged legislators to vote for the first failed resolution, his words are likely to have a stronger impact once he is in office.

"It is one thing to run a government by remote control and another to sit in the prime minister's seat," said Ilnur Cevik, editor in chief of the Turkish Daily News.

"Gul knew he was a transition prime minister and exerting your will on the party is very hard if you are a lame duck prime minister," Cevik said.

The Siirt by-elections were scheduled after Turkey's election board ruled that a ballot box there had been tampered with during the national vote.