BOSTON—Law-enforcement officers Tuesday fatally shot a man who, according to a person familiar with the investigation, was being monitored by antiterrorism investigators for suspected Islamic State sympathies.

Usaama Rahim, 26 years old, was shot at about 7:20 a.m. in the parking lot of a drugstore in the city’s Roslindale neighborhood.

The shooting occurred after an officer and agent decided to approach Mr. Rahim seeking to...