Two Cape Cod beaches were closed for swimming Saturday afternoon due to shark sightings, officials said.

Head of the Meadow Beach and Coast Guard Beach in Truro were closed from 1:30 p.m. to 2:30 p.m., the Truro Recreation & Beach Department said in a tweet.

Head of the Meadow Beach was also closed after a white shark was spotted by a spotter pilot at 2:46 p.m., according to the Atlantic White Shark Conservancy’s Sharktivity app.

The beach remained closed until 4 p.m., according to the Truro Recreation & Beach Department.

Andrew Stanton can be reached at andrew.stanton@globe.com. Follow him on Twitter @_andrewstanton.