MIAMI — The father of the shooter who terrorized a nightclub in Orlando, Fla., in June attended a campaign rally on Monday for Hillary Clinton, compelling her campaign to move quickly to distance itself from him.

The shooter’s father, Seddique Mateen, was spotted by a local television affiliate at the rally in Kissimmee, Fla., about 20 miles south of Orlando. He was positioned behind Mrs. Clinton as she spoke.

Asked by the affiliate, WPTV, whether the campaign knew he would attend the rally, Mr. Mateen said, “It’s a Democratic party, so everyone can join.”

On Tuesday morning, as news of his attendance set off an uproar on social media, Clinton aides moved to play down Mr. Mateen’s presence.