By Lesley Wroughton
CAIRO (Reuters) - A day before Egypt's deposed Islamist president goes on trial, U.S. Secretary of State John Kerry expressed guarded optimism on Sunday about a return to democracy in the country, as he began a tour partly aimed at easing tensions with Arab powers.
On his first visit to Egypt since the army removed president Mohamed Mursi in July, Kerry called for fair, transparent trials for all citizens. However, he described Cairo as a vital partner, apparently trying to repair relations hurt by a partial freeze in U.S. aid, pending progress on democracy.
Kerry said the relationship between the United States and Egypt should not be defined by aid but by a political and economic partnership.
When Egypt's first democratically-elected president stands trial on Monday, Kerry will already be on the next stage of his trip in Riyadh - where he must also try to soothe Saudi worries about Washington's positive response to overtures from Iran, and its stand on the war in Syria.
Referring to his recent comment that the Egyptian generals were restoring democracy when they deposed Mursi, Kerry said: "Thus far there are indications that this is what they are intending to do."
Relations between the United States and Egypt have deteriorated since Mursi's overthrow which unleashed violence in which hundreds have died, even though the government has published a "road map" for an eventual return to democracy.
Washington has repeatedly urged the interim government to act with restraint in cracking down on Mursi's Muslim Brotherhood and its supporters.
Kerry acknowledged that last month's decision by President Barack Obama to freeze some military aid as well as $260 million in cash, pending progress on democracy and human rights, had not gone down well in Cairo.
"We knew that in some places obviously that wouldn't be well-received but it's not a punishment," he told reporters after meeting Foreign Minister Nabil Fahmy. "President Obama has actually worked very, very hard to be able to make certain that we're not disrupting the relationship with Egypt."
Egypt has long been the second largest recipient of U.S. aid after Israel, with the military receiving $1.3 billion a year. However, Fahmy told Reuters on Saturday that Egypt would look beyond the United States to meet its security needs.
Washington has also held up the delivery of four F-16 fighter jets to the Egyptian air force.
In August the army crushed two pro-Mursi protest camps and has arrested thousands of Islamist supporters, including many top Brotherhood leaders.
A court order has also banned the group, Egypt's oldest Islamist movement, and seized its funds. Mursi, who has been held incommunicado since his overthrow, is due to face charges of inciting violence with 14 other senior Brotherhood figures.
Kerry next heads to Gulf ally Saudi Arabia, a major donor to Egypt's interim army-backed government. The kingdom appears to be increasingly frustrated with the United States over its perceived inaction on Syria, its diplomatic engagement with Iran and its lukewarm attitude toward the military-backed government in Egypt.
In Riyadh, Kerry will have his first meeting with King Abdullah since becoming America's top diplomat in February.
It will also be his first visit since a senior Saudi prince last month warned that the kingdom could "shift away" from the United States, suggesting a major strategic change after decades of close military and economic cooperation. In Washington, officials saw the threat as mostly rhetoric.
The White House has shown an increased willingness to risk strains with allies to pursue U.S. goals of avoiding military intervention in Syria and seeking a nuclear deal with Iran, Saudi Arabia's chief regional rival.
A senior State Department official, who requested anonymity, played down suggestions of a major rift with Riyadh.
However, the official acknowledged that Saudi Arabia opposes any Iranian participation in proposed Syria peace talks to end its 2-1/2 civil war. In addition, the Saudis expressed concern over Washington's recent talks with Iran about its nuclear program, according to the official.
Kerry will make clear to the Saudis that Iran would not be welcome to attend the Syria peace talks in Geneva unless it endorsed a past agreement that would see Syrian President Bashar al-Assad give up power, the official noted.
"Iran has not done that, and without that even we couldn't consider the possibility of their participating," the official added, stressing: "It is a question of just making sure they understand the details of how firm our position is."
On ending the stalemate with Tehran over its nuclear program, the official said: "We frankly completely agree with the Saudis about their concerns."
"By no means are we leaning toward loosening any of our views on what the Iranians have been doing to support terrorist operations and terrorist groups around the region," the official said.
Western governments fear the nuclear program aims to develop weapons but Iran says it is entirely peaceful.
(Interactive look at Egypt in crisis http://link.reuters.com/quw49t; Editing by Yara Bayoumy, Michael Georgy and David Stamp)