Twenty-three Iranian protesters who staged a brief takeover at the Iranian Interests Section of the Algerian yembassy here two weeks ago pleaded guilty yesterday to forcible entry of the embassy.

The Iranians, who support deposed Iranian president Albol Hassan Bani-Sadr and oppose Ayatollah Ruhollah Khomeini, have agreed in a plea bargain agreement to pay for the damages to furniture and other property at the offices of Khomeini's representatives here.

Assistant U.S. Attorney Michael L. Rankin said yesterday that, in exchange for the guilty plea, the government has agreed to drop a more serious felony charge against all 23 Iranians for destruction of embassy property. The unlawful entry charge to which they pleaded guilty yesterday is a misdemeanor punishable by six months in jail, a $500 fine or both. If the students had been convicted of a felony charge, they would have faced possible deportation.

U.S. Magistrate Jean F. Dwyer allowed the students to remain free on bond pending sentencing on Oct. 23. Rankin said the government will submit an itemized list of damages to the Iranians.

One demonstrator was shot and two other persons were injured during the incident, which the protesters said was conducted to condemn human rights violations in Iran.

The protester who was shot has been hospitalized since the incident and is being treated at D.C. General Hospital, according to attorney James R. Klimaski, who represents all 24 of the Iranians. He said they wre all students. The protester who as shot was also charged in connection with the incident and is expected to appear in court next week.

Meanwhile, the man accused of the shooting, Akbar Nouchedehi, has been charged with assault with a dangerous weapon and is being held in D.C. Jail on a $25,000 bond.

Police said that Nouchedehi, who had been a hostage, shot one demonstrator in the back as the protesters walked out of the diplomatic offices, with their hands above their heads, about to surrender to police after 20 minutes of negotiations. Police then apprehended Nouchedehi, who was hurt in the melee. Another demonstrator was injured when the Iranians fled from the offices after the gunshot, police said.

Prosecutor Rankin told the court that 20 of the protesters had forced their way into the diplomatic offices while four others went to the embassy roof with anti-Khomeini banners and posters. Employes in the office were harassed and threatened and some were held on the floor, sat on and tied up, Rankin said.

The anti-Khomeini Iranians staged the event specifically to get the attention of the media "so they could get their points known," Rankin said.