Updated

Radical left leader Alexis Tsipras was sworn in as Greece's new prime minister Monday after forming a surprise alliance with a small right-wing nationalist party Independent Greeks, signaling possible confrontation over the country's bailout.

The 40-year-old broke with tradition and took a secular oath rather than the Greek Orthodox religious ceremony with which prime ministers are usually sworn in.

Tsipras' anti-bailout Syriza party gained the backing needed to form a government by obtaining the support of Independent Greeks, which took 4.7 percent of the votes.

Although the alliance between two ideologically opposed parties who share only their opposition to the bailout was a surprise, it nevertheless boosted stock markets across Europe that had fallen on news of the uncertain election results and fear of a second election. Stocks had fallen as much as 4 percent in Athens on Monday morning, before recovering most losses. The stock market was down 1.6 percent in early afternoon trading.

Syriza won 36.3 percent of the vote in Sunday's early general elections but fell two seats short of the necessary majority in the 300-seat parliament to form a government on its own.

The details of who will serve in the government and whether the two parties will form a coalition or whether there will be a Syriza-only minority government supported by Independent Greeks were expected to be announced later Monday.

Tsipras has promised to renegotiate Greece's massive bailout agreements, but has vowed not to take any unilateral action against lenders from other eurozone countries.

Tsipras' choice to negotiate with the nationalist Independent Greeks -- a party aligned in Europe with the UK Independence Party -- rather than the centrist Potami caused concern that he could take a tough line in negotiations with rescue lenders.

Potami leader Stavros Theodorakis described the Independent Greeks as "far right and anti-European."

Syriza's financial planning official, Giorgos Stathakis, confirmed Monday that the new government had no plans to meet with negotiators from the "troika" of the European Central Bank, the European Commission and the International Monetary Fund and would instead seek talks directly with governments.

Greek voters swung to the once-marginal left-wing party after five years of punishing austerity measures demanded under 240 billion euro ($268 billions) bailout deals threw hundreds of thousands of people out of work and left nearly a third of the country without state health insurance.

Thousands of supporters turned out to watch Tsipras speak in central Athens after his opponents conceded.

"The Greek people have written history," he said, to cheers. "Greece is leaving behind catastrophic austerity, fear and autocratic government."

Outside the party's campaign tent in central Athens, supporters hugged each other and danced in celebration.

"It's like we've been born again and finally feel some hope," said Litsa Zarkada, a fired government cleaning worker. "We were thrown into the street just before we could take our pension. We have been through so much."

The new government faces an immediate cash shortage, with a dwindling primary surplus, upcoming loan repayments, and limits on the money it can raise using treasury bill auctions.

Megan Greene, chief economist at Manulife Asset Management, said the government will be unable to afford to run its day-to-day operations and pay back debt that falls due in March in the absence of additional cash from international creditors.

"Syriza and its creditors are stuck in a Gordian Knot, and both sides will need to cave on something. Neither Greece nor its creditors want Greece to default or exit the eurozone, so a compromise will probably be found," Greene told the AP.

The new alliance, she said, "suggests the new government will engage in dangerous brinkmanship with Greece's creditors as it tries to negotiate funding to stave off utter bankruptcy over the next few months."