CAIRO — Egypt’s bickering government and opposition need to overcome their differences to create “a sense of political and economic viability” if the country is to thrive as a democracy, U.S. Secretary of State John Kerry said Saturday.

He urged them to compromise for the good of the country.

In meetings with Egypt’s foreign minister and opposition politicians, some of whom plan to boycott upcoming parliamentary elections, Kerry said an agreement on economic reforms to seal a $4.8 billion International Monetary Fund loan package was critical. Closing the IMF deal also will unlock significant U.S. assistance promised by President Barack Obama last year.

But Kerry’s message to the liberal and secular opposition may have been blunted as only six of the 11 guests invited by the U.S. Embassy turned up to see the top American diplomat at a group meeting, and three of those six said they still intended to boycott the April polls, according to participants.

Undaunted, Kerry told reporters he had heard great passion from those who did attend and was convinced that they wanted to work in Egypt’s best interests.

But after meeting with Foreign Minister Kamel Amr, he acknowledged the difficulty in overcoming the deep differences. He said he would make that point to President Mohammed Morsi, an Islamist from the Muslim Brotherhood, in their talks Sunday.

“I say with both humility and with a great deal of respect that getting there requires a genuine give-and-take among Egypt’s political leaders and civil society groups just as we are continuing to struggle with that in our own country,” Kerry told reporters, in apparent reference to the current stalemate in Washington over the federal budget.

‘There must be a willingness on all sides to make meaningful compromises on the issues that matter most to all of the Egyptian people.”

Kerry spoke by telephone with Mohammed ElBaradei, a Nobel peace laureate who heads the National Salvation Front, an opposition coalition calling for the election boycott.

He also met privately with Amr Moussa, a former minister under ex-President Hosni Mubarak who’s now aligned with the Salvation Front. Moussa, an ex-Arab League head, ran for president last summer.

Neither ElBaradei nor Moussa attended the group meeting.

The Salvation Front says now is not the time for elections that will further polarize the country while violent clashes continue between protesters and security forces, further shaking the faltering economy.