Monwell Wright, 20, was indicted by a grand jury and charged with two counts of felony attempted robbery, and one count each of felony and misdemeanor assault before Judge William Condon in Suffolk County court.

Mr. Wright — wearing a green jail jumpsuit — pleaded not guilty to the charges and was held on bail.

Assistant District Attorney Michelle Chiuchiolo said Mr. Wright and a girlfriend attacked the victim while the man was walking on Sweezy Avenue on his way to take the train to work about 6:15 a.m. Jan. 24.

Mr. Wright and his friend approached the victim near the intersection of Pulaski Street, according to a police report. While the woman pointed a handgun at the victim, Mr. Wright reportedly hit the man over the head with a large rock, knocking him down, Ms. Chiuchiolo said.

Mr. Wright continued to beat the victim, demanding cash, until a vehicle drove by during the assault, prosecutors said. Police say Mr. Wright and the woman fled without any of the victim’s money.

Ms. Chiuchiolo said the victim needed several stitches to close up a wound on his face and identified Mr. Wright as his attacker.

Mr. Wright was arrested a day after the assault without incident following a police investigation. Mr. Wright was carrying a Desert Eagle airsoft pistol at the time of his arrest, prosecutors said. Riverhead police also said Mr. Wright was in possession of a prescription drug, but he was not arraigned on any drug charges in county court Thursday.

The woman who the victim said held him at gunpoint has not yet been arrested, police said.

Ms. Chiuchiolo told Judge Condon that the defendant “may have been involved in other incidents similar to this,” though she did not elaborate further. A second robbery that occurred the same day as Mr. Wright’s alleged attack is still under investigation, police said. No further arrests or charges have been made in relation to the incidents.

Mr. Wright also has a pending stolen property charge, relating to his alleged theft of a Ford F-250 pickup truck in front of a Riverhead deli about 5 weeks ago, Ms. Chiuchiolo said. He was also arrested in November for trespassing after he was found sleeping in a school bus at the Riverhead School district’s bus barn.

He was originally held on $500 bail after his arrest in the stolen vehicle incident, but was released from jail on his own recognizance Jan. 10, county jail officials said.

Mr. Wright’s attorney, John Schick, said that while his client’s homelessness may impact his eligibility for a lower bail, the amount asked for by the prosecution was “excessive.” The judge disagreed.