KYIV, Ukraine - Ukraine's president and prime minister reached agreement Friday on holding early parliamentary elections in a bid to end a bitter political standoff.

The agreement ends a dispute that arose after President Viktor Yushchenko dissolved parliament April 2 and called early elections.

But while Yushchenko won the battle over early elections, the real fight for control over the next parliament still looms. Polls show Yushchenko's pro-western allies trailing Prime Minister Viktor Yanukovych's Russian-leaning party.

Yushchenko called the agreement "the answer that the nation was waiting for.''

"I would not like for what happened today to be understood as the victory of one force over another,'' he said. "Undoubtedly, common sense ... prevailed.''

After emerging from talks with the president, Yanukovych went to speak to thousands of flag-waving supporters gathered on Kyiv's Independence Square. "There is no other way to solve this crisis except by holding democratic and fair elections,'' he said.

The former Soviet republic has been mired in a political crisis since Yushchenko's decree -- a move he said was necessary to prevent Yanukovych from usurping power. Yanukovych and his majority in parliament ignored the decision, calling it unconstitutional.

As the standoff dragged on, both sides brought their supporters to the streets for major rallies, and accused each other of acting in bad faith.

Yanukovych appealed to the Constitutional Court, but it moved slowly in its deliberations and Yushchenko said the 18-judge panel was not up to the task, firing two of the judges this week.

Yanukovych emerged from the meeting with the president to say a breakthrough had been made. He told thousands of his supporters at an outdoor rally that the two leaders agreed to the creation of a working group that will decide what laws need to be adopted and when the election will take place. Previously, Yushchenko had set the election date for June 24.

Yushchenko said the working group was given a Monday deadline to present its suggestions on how to proceed. He acknowledged that parliament would have to reconvene to approve changes to election law and this year's budget to release funds for the election, but said he thought that could be done in one day.

He suggested that could happen Tuesday, saying he would be present to sign the bills into law immediately. After that, Yushchenko said the election would likely take place within 60 days -- meaning the vote might come in early July.

Yanukovych had repeatedly said he would not agree to early parliamentary elections unless a presidential vote were held simultaneously. Neither leader mentioned a presidential balloting Friday, suggesting he backed down on the demand.