PRAGUE (Reuters) - Czech Social Democrat leader Miloš Zeman, who was named prime minister by President Václav Havel on Friday, has achieved a bitter-sweet victory. Zeman, whose centre-left party topped the poll last month for the first time since the end of Communist rule, achieved his long-standing ambition but at the cost of having to cooperate with his political rival, ex-premier Vaclav Klaus. The new prime minister‘s appointment almost slipped his fingers due to a surprisingly strong showing by Klaus and the centre-right in the polls which left the Social Democrats far short of a majority in parliament. Zeman, 53, and Klaus, known for their deep mutual animosity, proved flexible and signed a controversial pact under which the Civic Democrat Party (ODS) will not initiate or support a vote of no confidence in Zeman‘s minority cabinet. The agreement caused uproar among other parties and upset Havel who has said the two big groups, with a constitutional majority, may be tempted to freeze smaller parties out of power for good. The Social Democrats won 74 out of 200 parliamentary seats in the June 19-20 election but a combined 102 seats for the centre-right made Zeman‘s prospects of forming a cabinet bleak, prompting commentators to declare it a Pyrrhic victory. He attempted to form a centre-left coalition but failed to find support and eyes were turning to Klaus, expected to lead talks on a centre-right coalition. But Klaus, still bitter at the leaders of the other two centre-right parties who sank his coalition last autumn over a political donations scandal, threw Zeman a lifeline with a speed which surpised analysts. Both parties repeatedly ruled out any kind of cooperation after the election. Klaus based his campaign on the slogan „To the left or with Klaus“. When the deal was signed, right-wing Freedom Union leader Jan Ruml was quick to turn it into „To the left with Klaus“. Zeman likens himself to Britain‘s Prime Minister Tony Blair and his „New Labour“, and supports joining the European Union and NATO. He was one of the few older Czechs marching with student demonstrators on November 17, 1989, in the rally which triggered the peaceful downfall of the Communist government several days later. Although the Social Democrats count some former communists among their members, the party was reborn in 1989 by rejecting official ties to the remnants of the Communist Party which had held power for four decades. Zeman was briefly a Communist, but that was as a student during the „Prague Spring“ democratic reforms of 1968. He was expelled from the party in the purges which followed the Soviet-led invasion of the country the same year.