BARNSTABLE ― A Mashpee man has been sentenced to perform 50 hours of community service for the August theft of three flags from the First Responders Appreciation Overpass at Exit 5 on Route 6.

Alexander McGee, 27, admitted sufficient facts existed for a guilty finding Wednesday in Barnstable District Court for a charge of larceny stemming from incident, in which he allegedly stole and damaged three flags with police and firefighter insignias, according to court documents. McGee will also be required to write an apology letter and remain under the care of a psychiatrist, the documents say.

A charge of vandalizing property was dismissed.

According to a report by Barnstable police Officer Anson Moore, a witness reported seeing McGee take down the flags on the overpass, first by pulling on them and then by cutting them.

The witness gave officers a license plate, and Mashpee police waited for McGee at his residence and arrested him.

When Moore arrived at the Mashpee address officers told him the flags had been in plain sight on the front seat of McGee’s car. Officers also found a utility knife believed to have been used to cut them, Moore wrote.

After Moore took McGee back to the Barnstable Police Department, McGee said he wanted to apologize for his actions, which he called “a stupid street prank,” and said were not targeted at police or firefighters.

Moore pointed out that McGee bypassed American flags and emergency medical service flags that hang on the bridge and walked about 50 yards across the road to take only flags with police and firefighter insignias.

Moore is the father of Ryan Moore, one of two Falmouth police officers shot July 27 while responding to a disturbance.

On May 2, the Legislature designated the bridge near Exit 5 spanning the eastbound and westbound sides of Route 6 as the First Responders Appreciation Overpasses and ordered that the state Department of Transportation erect and maintain “suitable markers” for the designation. The state law makes no mention of flags.

The flags cost about $90 each and were made by a World War II veteran from Franklin named Thomas Hewit, according to Yarmouth Deputy Police Chief Steven Xiarhos. They were crafted so that they could be clamped onto the bridge, making them difficult to remove, Xiarhos said. Xiarhos befriended Hewit after he made a flag to honor Xiarhos’ son, Nicholas Xiarhos, who died in 2009 while serving with the U.S. Marines in Afghanistan, he said.

McGee took the flags on National Night Out, which is intended to be a time for police and the communities they serve to come together.

— Follow Kristen Young on Twitter: @KristenCCT.