Yemeni President Ali Abdullah Saleh has agreed to step down as long as power is transferred to "clean hands," Fox News has learned. 

Saleh did not give a timetable when this would happen as he spoke before a crowd of tens of thousands of supporters outside his presidential palace in the Yemeni capital of Sanaa Friday.

The troubled Yemeni leader has had meetings with Gen. Ali Mohsen -- a top general in Yemen who defected to the anti-government protesters -- about possible transfer of power.

"In the past 48 hours, there were meetings between the president and Ali Mohsen," Saleh's media secretary Ahmed al-Sufi told Reuters. "Ali Mohsen clarified why he did what he did, and requested assurances that nothing would happen against him."

Across town, an even larger number converged on a square chanting slogans calling for his ouster and waving red cards emblazoned with the word "leave" despite fears of more violence a week after government security forces shot dead more than 40 demonstrators in Sanaa.

The bloodshed last Friday prompted a wave of defections by military commanders, ruling party members and others, swelling the ranks of the opposition and leaving the president isolated.

Saleh also imposed a state of emergency that allows media censorship, gives wide powers to censor mail, tap phone lines, search homes and arrest and detain suspects without judicial process.

The president, who has held power for more than three decades, has repeatedly sought to appease the protesters to no avail.

"We in leadership, we don't want power but we need to hand it over to trustful hands, not to sick, hateful, corrupt, collaborator hands," Saleh told his supporters, who carried pictures of the president and signs reading "No to terrorism!"

"We are ready to leave, but we want to do it properly and at the hands of our people who should choose their leaders," he said, calling the opposition a small minority of drug dealers, rebels and illegal money traders.

Security forces parked tanks and military vehicles close to the palace and beefed up their presence around Saleh's ruling party building and the interior ministry.

As he spoke, Saleh's forces tried to prevent more anti-government demonstrators from entering Sanaa. Troops manning checkpoints on roads leading to the capital searched cars, trying to identify protesters, said a demonstrator who was turned away, Hamid al-Hawlani.

"We were in a car of some 25 people, but soldiers told us that the capital was closed," said al-Hawlani, whose tribe has joined anti-Saleh protests. "They said we could come after the protests end."

Protesters who had called for a million people to gather in Sanaa on Friday -- the holiest day of the Muslim week, where believers traditionally congregate in mosques -- also stepped up security around the downtown square where they have held demonstrations for weeks.

Pro-demonstrator forces patrolled the square clutching assault rifles and searching people trying to enter the square. Hundreds of people lined up, many clad in white robes and turbans, with prayer mats tossed over their shoulders for noontime prayers.

"We are trying to gather as many people as possible here. He needs more pressure to leave," said demonstrator Magid Abbas, a 29-year-old physician. "We have great hopes."

Saleh is already under a great deal of pressure. Following last Friday's killings, senior military commanders, lawmakers, Cabinet ministers, diplomats and provincial governors jumped ship and sided with protesters. Boosted by the swell of support, Yemen's hardened opposition turned down Saleh's offer to step down by the end of the year, saying they did not trust him. Instead they demanded he leave immediately and called for constitutional change that would limit presidential terms.

The Associated Press contributed to this report.