Eulalio Tordil, 62, is suspected of killing his estranged wife Gladys outside a high school on Thursday.
The next day, one person was killed and two more injured after being shot near a shopping mall in Bethesda.
In a second incident on Friday, a woman was shot and killed eight miles (13 km) away shortly afterwards.
Mr Tordil is a police officer with the Federal Protection Services, which provides security to US government buildings.
He was arrested by tactical officers "without incident" near to where Friday's second shooting took place.
Police believe he killed his estranged wife outside the High Point High School in Maryland on Thursday as she was picking up her children.
A man who went to her aid was also shot and injured.
Mr Tordil was charged with first-degree murder for his wife's killing and assault for the shooting of the bystander at the school.
The Federal Protective Service says that Mr Tordil was placed on administrative leave in March after a protective order was issued against him.
On Friday, gunfire erupted at the Westfield Mall in Bethesda then the second shooting happened at a supermarket in nearby Aspen Hill.
A police officer has been arrested on suspicion of shooting dead his wife and two other people in Maryland, and injuring three others.