An animal believed to be a mountain lion attacked a child walking along a park trail on Sunday morning near Cupertino, officials said.

Rangers closed Rancho San Antonio County Park, where the attack happened around 10 a.m., while officials investigated the incident and worked to track down the animal. It is the third time since August that the park has been closed because of mountain lion sightings.

The child was on a stretch of trail about 2 miles from the main parking lot when the animal attacked. Adults, who were with the child, scared away the animal before a ranger with the Midpeninsula Regional Open Space District responded and provided first aid to the child.

The child was treated at the scene for minor injuries and released, officials said.

The park and neighboring preserve will reopen when investigators determine it is safe, officials said.

The 3,988-acre preserve, combined with the adjoining 165-acre park, includes 24 miles of trails for hiking, biking and horseback riding, a grassy meadow play area, picnic space and a small farm.

Tatiana Sanchez and Evan Sernoffsky are San Francisco Chronicle staff writers. Email: tatiana.sanchez@sfchronicle.com, esernoffsky@sfchronicle.com Twitter: @TatianaYSanchez, @EvanSernoffsky