Two men charged with robbing two University at Buffalo students in their University District apartment each pleaded guilty Monday to two counts of first-degree robbery, Erie County District Attorney Frank A. Sedita III announced.

On March 28, Donovan Haigler, 25, and Lance Minton, 23, entered an apartment of two female students on Winspear Avenue.

Prosecutors said they robbed the students at gunpoint, taking money and marijuana before fleeing.

The victims called 911 and also reached out to friends because they thought they recognized one of the robbers. The students quickly established that one was named “Donovan,” officials said. They also searched Facebook acounts and found photos of the robbers. They turned over the information they turned up to Buffalo police.

Investigators quickly tracked down Haihler and Minton at 45 Tyler Street and brought them to the crime scene where the victims identified them.

Haigler confessed to the home invasion but Minton refused to cooperate. A search of a car registered to Haigler’s apparent fiancee, parked in front of their apartment, turned up the stolen pot and the gun, which was loaded.

Buffalo police were assisted by UB police.

Haigler and Minton are scheduled to be arraigned before State Supreme Court Justice Christopher Burns on Feb. 13. They face a maximum of 25 years in prison but Judge Burns has indicated he will likely impose the statutory minimum of five years, according to Sedita’s office,