A Montgomery County lawyer charged with sexually assaulting a young girl was arrested during the weekend after British customs agents refused to allow him to enter England with a false Irish passport, Montgomery County Sheriff's Department officials said yesterday.

Ricardo E. Perez-Ribalta, 37, was being detained last night in Toronto, where he was arrested Saturday by immigration authorities. Perez-Ribalta left Canada Nov. 27 for Gatwick, England, but was ordered to return to Toronto because of passport problems, said Sgt. Ronald Frye, head of the Sheriff's Department warrant-fugitive squad.

An arrest warrant was issued Oct. 29 for Perez-Ribalta after he failed to appear in Montgomery County Circuit Court for the start of his trial on kidnapping and sexual assault charges. Perez-Ribalta, who also owns a janitorial service, is accused of abducting and sexually assaulting a 12-year-old girl Oct. 16, 1989, in Gaithersburg.

Police said Perez-Ribalta lured the girl into his car by posing as a police officer. He then called 911 from his car phone to report a runaway, tried to handcuff the victim and later assaulted the girl at knifepoint, police said.

Perez-Ribalta faces life imprisonment if convicted of the more serious charge of first-degree sex offense. He is expected to be returned to Montgomery County in about two weeks, Frye said.

The search for Perez-Ribalta was one of the most extensive fugitive investigations for the Sheriff's Department, said Cpl. Jim Dunn. "This was not the usual warrant where you find the suspect in the basement hiding in the dirty clothes. Perez-Ribalta knew what he was doing."

The entire 15-person warrant-fugitive squad participated in the investigation, Dunn said. The FBI, Interpol, the State Department and U.S. Postal Service inspectors also helped, Frye said.

The break in the case came the day before Thanksgiving when sheriff's deputies tracked Perez-Ribalta to a prayer meeting at a Seventh-Day Adventist Church in Toronto, said Dunn. Authorities said Perez-Ribalta flew from National Airport Oct. 29 to Buffalo, with his girlfriend, Mary C. Casey, a native of Ireland who had worked as a nanny here. The pair then caught a bus to Toronto, Dunn said. Casey, now in Ireland, has been charged with harboring a fugitive.

Days before Perez-Ribalta fled the area, police said he and Casey cashed a total of $400 in checks at eight Giant stores.