(CNN) -- Yemeni President Ali Abdullah Saleh and a top military general are discussing a deal for a peaceful transition of power that would allow Saleh to stay in place for the rest of the year, a Yemeni official and senior U.S. official said Monday.
The discussions come amid cracks in support for Saleh's 32-year rule after weeks of anti-government protests.
Three top generals declared their support for the protests Monday, including Maj. Gen. Ali Mohsen Al-Ahmar, the man now discussing the deal with Saleh.
Al-Ahmar, who belongs to an important tribe whose backing is significant for Saleh, also said he will order his troops to protect civilians demonstrating against the president.
A wave of other officials announced their support for the opposition Monday.
They included Yemen's ambassador to Britain and the embassy's entire diplomatic staff, and Yemen's ambassador to the European Union, Mohamed Jaffer. They did not resign but rather threw their support behind the protesters.
Dozens of other ambassadors and officials also announced their support for the "peaceful revolution," a high-level Yemeni source said. Among them were a provincial governor, members of parliament and the governing party, an official in the prime minister's office, top envoys to Saudi Arabia, China and Pakistan, and diplomats in the U.S. and Russia.
Yemen's United Nations ambassador, who resigned Sunday, said Monday that Saleh should make a dignified exit for the good of the country.
"The president has done some good things, but everything has an end, and he should step down," Abdullah Al-Saidi said.
According to the Yemeni official who confirmed the talks between Saleh and the general, the president has officially accepted five points demanded by the opposition and is now waiting for a response from the opposition and the generals who defected.
The five points are that Saleh step down by the end of the year; that Yemenis be allowed to protest without fear of violence; that a committee be formed to investigate attacks against protesters; that families of all protesters killed or wounded be compensated by the state; and that the government implement constitutional and electoral reforms, including the removal of Saleh's family members from the armed services.
"The ultimate goal is peaceful transition with a clear, set timeline" that has yet to be determined, the Yemeni official said.
A U.S. official said Monday that Saleh is losing the support of his political and military leaders. Although most of the top brass still supports the regime, the official said, their support is "tenuous."
Saleh has been a key United States ally as al Qaeda turns his country into a base. Radical American-born cleric Anwar al-Awlaki is believed to be hiding in Yemen.
The cleric has been linked to terror plots including the attempt to bomb a Detroit-bound plane on Christmas Day 2009, and he corresponded separately with a British Airways employee about trying to smuggle explosives onto planes.
Top American officials including U.S. President Barack Obama's counterterrorism chief have traveled to Yemen to meet with Saleh, and leaked diplomatic cables suggest Saleh's government helped disguise strikes by U.S. unmanned drones on terror targets in Yemen by calling them Yemeni actions.
In terms of U.S. counterterrorism efforts with Yemen, the U.S. official said it "doesn't help when you don't have government cooperation," but there are "other things being done" to continue the work, including "dialogue with partners" as well as the use of other "multiple means to gain information on terrorist activities."
A high-level Yemeni source said Saleh can hang on to power if he unleashes the forces still loyal to him. The source did not know whether the president will do that, however, and was not sure a tipping point has been reached.
Saleh may be reaching out to regional powers for support in the face of protests.
He is sending Foreign Minister Abu Bakr Al-Qirbi to Saudi Arabia with "a presidential letter to the Saudi monarch," the first Yemeni source said, adding that he did not know what is in the letter.
The Saudis did not respond to requests for comments about the message from Saleh.
"Government officials in Yemen see what's going on today as having the signs of an early stage of a bloodless coup," the Yemeni official said.
Saleh dismissed his Cabinet on Sunday, after the weekend resignations of two top officials to protest a government crackdown on protesters that left 52 people dead Friday.
Saleh expressed his "deep regret" over the casualties and asked the officials to stay on until a new Cabinet is appointed, according to Tareq Al-Shami, a spokesman for the country's ruling party.
Yemen's chief prosecutor has launched an investigation into the shootings in Sanaa and is questioning 17 people accused of orchestrating the massacre, the country's embassy in the United States announced.
Human Rights Minister Huda al-Bann resigned over the crackdown, according to an official in her office who is not authorized to speak to the media and asked not to be named.
Senior ruling party member Mohammed Abulahoum said Sunday that Saleh "should seriously consider a good, safe exit strategy" to "prepare the foundation in Yemen for a good transfer of power from him to the next authority or president."
Abulahoum "strongly" condemned Friday's violence and, in protest, withdrew a plan he proposed to mediate between the president and the opposition.
High unemployment has fueled much of the anger among a growing young population steeped in poverty. The protesters also cite government corruption and a lack of political freedom.
The president has said he will not run for another term in the next round of elections. He also has pledged to bring a new constitution to a vote by the end of the year and transfer government power to an elected parliamentary system.
CNN's Caroline Faraj, Elise Labott, Richard Roth, Pam Benson and Jo Shelley and journalist Hakim Almasmari contributed to this report.