A Boston man wanted for rape was caught taking upskirt photos at the Porter Square train station, police said.

James Cullers, 51, was reportedly taking secret videos of female passengers at the MBTA station around 3:30 p.m. on Tuesday, transit police said. 

When officers arrived on scene, a woman told them that a fellow passenger had pointed out Cullers, saying "He's video taping up your skirt."

The woman had confronted Cullers who allegedly admitted to the act and said he would delete the video. When officers approached Cullers, he started to "manipulate his phone and apologize," police said.

Cullers was arrested for making a secret video (known as the upskirting law, police said) and transported to Transit Police Department headquarters for booking. 

During that process, officers discovered there was a warrant for Cullers's arrest from Wareham District Court for rape and two counts of indecent assault and battery on a person over 14. 

Cullers was given a $30,000 cash bail when arraigned in Cambridge District Court on Wednesday, according to Elizabeth Vlock, spokeswoman for the Middlesex district attorney's office.

He was also ordered to wear a GPS monitoring bracelet and to stay away from and have no contact with the victim or witnesses, as well as to stay away from MBTA stations. 

Cullers is due back in court Oct. 20.