Isabella Yip, 6, looks at an Ice Cream Trail brochure at Woodbourne Creamery at Rock Hill Orchard , the newest addition to the trail. (Kenneth K. Lam/Baltimore Sun)

People will travel miles and miles to sample fresh-off-the-farm ice cream and learn about the treat’s origins.

“People really like to be able to come out to a farm and see the animals,” said Megan Keyes, who, along with her parents, runs Keyes Creamery in Aberdeen, one of nine stops on “Maryland’s Best Ice Cream Trail.” “It’s something that consumers don’t necessarily get to see every day — or even in a lifetime, depending on where they live.”

The state Department of Agriculture launched the trail five years ago with seven farms that make and sell ice cream to consumers to encourage them to visit working farms — and buy local. Now with nine stops, it stretches more than 290 miles from Ocean City in the east to Washington County in the west, offering a taste of Maryland’s dairy industry.

The initiative has boosted Maryland agri-tourism, which is helping farmers diversify by tapping into a growing trend of mixing travel with a burgeoning interest in local food and agriculture-related experiences. Farms that might raise cattle or grow produce are luring tourists with shops that sell their meats, vegetables, eggs and cheeses. Some are adding such attractions as ice cream stands, wineries and breweries. Many offer tours of production facilities, pick-your-own fruit and vegetable operations, and weekend events.

“Ag tourism in Maryland, as in many states, has grown as a source of income for farmers,” said Mark S. Powell, chief of marketing and agribusiness development for the state Agriculture Department, which since 2001 has been working to promote local products and farms. “There’s been a significant increase in consumers’ awareness of where their food comes from. . . . There’s an interest in connecting with farmers and wanting to support local agriculture.”

According to a 2012 count by the U.S. Department of Agriculture, 307 Maryland farms offered an agri-tourism operation, up from 231 in 2007.

And new operations open frequently. Earlier this month, Hawks Hill Creamery in Harford County opened a farm brewery, Falling Branch Brewery, which brews beer using hops grown on the farm, and added a weekend beer garden that also offers ice cream and pit beef.

Such agri-tourism offers farms greater viability with added income, which can make passing them from one generation to the next easier. That’s why a grain farm in Dorchester County added a vineyard and winery, Layton’s Chance, in 2010.

“We’ve grown every year,” said William Layton, who owns the winery with his wife and parents, offering tours and tastings and weekend concerts at the farm, east of Cambridge. “Where I compete is both people that want to buy local to support local products and as an experience. We’re more than buying a bottle. You come out and have a picnic and relaxing day at the winery.”

A state analysis showed that direct-to-consumer sales of specialty crops — the focus of the state’s Maryland’s Best advertising and promotions — increased 24 percent between 2007 and 2012 to $28 million.

As of 2012, nearly 80 percent of Maryland residents preferred products identified as grown in the state, compared with 55 percent of residents who five years earlier had said they preferred locally grown products, according to the department.

Since the Ice Cream Trail was devised, about 400 people have completed it, Powell said. The state Agriculture Department printed a brochure that visitors can get stamped at each stop and then submit for an annual prize drawing.

“They’re ice cream lovers, and they go to each area and try each one,” said Janey Wolff, who oversees ice cream production at Broom’s Bloom Dairy in Bel Air, where visitors can see ice cream being made, eat lunch or dinner, and buy ice cream as well as locally produced eggs and meat. “It definitely does help,” Wolff said.

Besides Keyes and Broom’s Bloom, stops include Prigel Family Creamery in Glen Arm, Kilby Cream in Rising Sun, South Mountain Creamery in Middletown, Rocky Point Creamery in Tuscarora, Misty Meadows Farm Creamery in Smithsburg and Chesapeake Bay Farms in Berlin. Woodbourne Creamery in Mount Airy was added this year.

The idea is to give a boost to the dairy industry, which has struggled with income swings year to year; competition; and, last year, the declining price of milk amid higher expenses. Maryland had 443 dairy farms in 2015, down from 649 a decade earlier, according to the state Department of Health and Mental Hygiene.

Keyes and her family faced such difficulties on their Havre de Grace dairy farm when they expanded with the creamery in 2001 to make ice cream and cheese using milk from the dairy farm for the wholesale market. They opened the retail shop in 2013, Keyes said.

Sales of ice cream and cheese now outperform the farm’s dairy business, she said.

“We weren’t getting paid a lot for the amount of milk we’re producing and looked for a different outlet to market,” she said. “This is the direction we’re heading — doing more with the creamery.”

The owners of Woodbourne Creamery at Rock Hill Orchard, the newest member of the Ice Cream Trail, began farming six years ago when they bought Rock Hill, a pick-your-own fruit and vegetable farm, then built a dairy-processing facility.

Owners John and Mary Fendrick opened the creamery in 2014, and visitors now can see the dairy herd; watch cows being milked by a robotic, voluntary milking system; see ice cream being made; and sample the milk and ice cream, which is sold only at the farm store and at some farmersmarkets.

“Ice cream is something people come to over and over again,” said John Fendrick, who found out about the Ice Cream Trail while researching the market. “It’s another way to drive business to us. . . . We have an open farm. Our intent is we want people to come.”

— Baltimore Sun