Indonesian President B.J. Habibie named military commander Gen. Wiranto as his vice presidential running mate today in an effort to keep his floundering re-election hopes alive.

Wiranto's selection was seen as a last effort by Habibie to hold onto power by winning the backing of the powerful military and its bloc in the 700-member People's Consultative Assembly, which is scheduled to choose the next president Oct. 20.

"We need good cooperation with the military. That is why I want to have a military man as my running mate," Habibie said. "A vice president has to help the president handle threats faced by the nation."

Wiranto did not respond publicly. Many analysts believe there is a chance he could also be offered the vice presidency by Habibie's main rival, opposition leader Megawati Sukarnoputri, who also needs military backing. Her presidential ambitions have suffered a series of setbacks recently, however. Her party, which controls about a third of the assembly seats, lost several key votes after being outmaneuvered by a Muslim bloc determined to stop her.

The presidential race--the first competitive contest in Indonesia's history--became even more muddled with the entry of a Muslim leader, Abdurrahman Wahid, a nominal Megawati ally whose quixotic candidacy has thrown the race into confusion.

Habibie's announcement came just hours after the president's own Golkar party reluctantly backed him as its sole candidate. A small but influential reform wing in Golkar, led by deputy chairman Marzuki Darusman, had been pushing to have the unpopular Habibie removed, but members opted to retain him with an escape clause: he can be dumped later if his chances recede further.

A key test comes Thursday, when Habibie delivers what is known as his accountability speech to the people's assembly. The assembly will have to vote Friday whether to accept Habibie's speech, and a vote to reject would be a clear signal that he has lost his mandate--and his chance for another term. That would open the way for Golkar to endorse a new candidate.

"There are several alternatives," Golkar chairman Akbar Tandjung said. "If it is not possible to fight for our candidate, we shall look for an alternative candidate." One option, he said, was "to give support to [one of] the existing candidates."

That statement appeared to signal that at least some Golkar members, including Marzuki and Akbar, might support Megawati. Akbar has been mentioned as a possible Megawati vice-presidential candidate for bringing the crucial Golkar reform bloc over to her camp.

Habibie is viewed as unpopular because of his long association with the discredited former president, Suharto. That link seemed reaffirmed for many this week when Habibie's acting attorney general dropped an investigation into the sources of the Suharto family's vast wealth--estimated at more than $1 billion--because of insufficient evidence.

Habibie is also blamed for his referendum on East Timor, in which people voted overwhelmingly to separate from Indonesia. He has also become linked to a scandal involving a questionable $70 million payment by an ailing bank to a top Golkar party official.

Megawati is considered the most popular candidate because her party, the Indonesian Democratic Party of Struggle (PDI-P), won last June's elections with 34 percent of the vote, some 12 percentage points ahead of Golkar. But PDI-P is well short of holding a legislative majority.

Wahid's surprise entry into the race has been the source of intense speculation. Some believe he remains a Megawati ally and that his candidacy is really a way of blocking support for Habibie from Muslims uncomfortable with a Megawati presidency. Others say Wahid harbors his own presidential ambitions and sees himself as a compromise candidate between Habibie and Megawati.