NORTH ANDOVER — The sheep weren’t the only ones losing layers to keep cool at the 47th Annual Sheep Shearing Festival Sunday, as children and parents stripped off their jackets and tied them around their waists as the sun finally made an appearance.

Gathered around the perimeter of a wire fence, dozens of people watched as border collies herded sheep and goats around the grass. From small children atop their parents’ shoulders to others peering through the spaces in the fence, everyone was trying to get a close look at the animals.

“I love watching the dogs,” said six-year-old Lily Gomes, who attended the festival this year for her first time. Gomes and her grandmother were among those right up at the fence.

Watching closely as the dogs quickly made their way through the grass at the sound of the whistle, Gomes, as well as many others in attendance, were amazed at their speed and obedience.

The festival also featured dozens of food vendors, live musical performances, pony rides, cow-pie bingo and a sheep-shearing demonstration — a crowd favorite.

Jacob Nevins, 14, of North Andover, said his favorite part of the festival, besides the food, was watching the sheep shearing. He has been attending the annual event since he moved to town in second grade, and said he looks forward to it every year.

Huddled in a close-knit circle around two black sheep, people watched closely as the shearer explained and demonstrated the tricks and skills necessary to successfully shear a sheep. He explained how to properly position the sheep and trim their fur off in a way that would avoid causing any harm or injuries to their skin.

With one of the sheep placed firmly between his legs, the shearer glided an electric shear through its fur as black pieces of wool fell to the ground.

Nevins and his friends Francesca Oliveto, 14, also of North Andover, and Jack Vermette, 13, spent the final day of their weekend enjoying everything the festival had to offer. The trio said one of the highlights was the food, noting that the French fries and fried rice balls were among their favorites.

Oliveto, who lives right up the street from where the festival is held at the Town Common, said she comes every year.

“It’s a really fun event for the town and the kids seem to really enjoy it,” said Vermette, who doesn’t live in town but still attends with friends. “I really like watching them herd the sheep, too.”

Kids took their turns riding ponies as their parents stood close-by with their cellphones in hand for pictures.

The brown and white ponies carried the children around in circles, though some were more afraid of being seated on the animals than others.

Hundreds of people came out for the annual festival, and the weather was in their favor as the rain turned to sunshine for the majority of the day.