TROY, Maine — Her head shaded from the sun by a wide-brimmed hat, Rachel Katz crouched in verdant rows of watermelons and cantaloupes late Wednesday afternoon while her two small children helped fill plastic crates with the fruit to sell for the next day’s market.

The 33-year-old co-owner of Terranian Farm is one of a growing crop of young farmers in Maine, and a return of the summer heat meant that the harvest was in full swing. It was hot and busy, but Katz took a moment to cut into a juicy melon to make sure it was perfectly ripe. She sliced off pieces for the farmworkers and her children to enjoy while she talked about farming life.

“I feel like it’s important work, and that’s what I like about it,” the farmer, originally from East Brunswick, N.J., said. “I think it’s a moral imperative. And I think it’s a healthy environment for me to raise my family.”

As with Katz and her partner, 36-year-old Sam Hazlehurst, more and more young people — both from Maine and from away — are choosing to take up the work of farming. Their growing numbers are bolstering the state’s ability to provide food, filling up stands at local farmers markets and contributing to the current local food movement, according to statewide agricultural experts. But they are facing challenges that include the high price of buying land and the dawn-to-dusk grind that often is required to make a living in the industry.

The most recent farm census data from the USDA shows that the number of farmers under 25 in Maine tripled between 2002 and 2007. The number of farmers between 25 and 34 years old doubled in the same time period. Although the numbers are a little dated, with the next agricultural census not expected to be released until February, the trend appears to be holding steady.

John Piotti, executive director of the Belfast-based Maine Farmland Trust, said recently that farming in Maine has been growing for at least a dozen years, and probably has picked up speed in the last five to eight years.

“We’re very proud of the fact that in Maine, we have a very old population in the state, and a relatively young average age for farmers,” he said. “A lot of that growth is young farmers. We deal all the time at the Maine Farmland Trust with young people trying to get into the profession.”

That represents a big switch, he said, adding that agricultural statistics show Maine “bottomed-out” for farming about 20 years ago. More of the state’s aging farmers wanted out of the profession, with fewer young people wanting to sign up for the farming life. One key component to the reversal are the programs offered through the Maine Organic Farmers and Gardeners Association for new farmers or curious would-be farmers.

Andrew Marshall, education director at MOFGA, said the apprenticeship program is for people who are “kind of kicking the tires” about farming. About 1,500 people in the last 10 years have gone through the program, with many either still in college or having just graduated. The young people offer their labor in exchange for weekly stipends, room and board — “all the vegetables you can eat,” Marshall said — and experience. The program has easily doubled since it started taking off in 2005, he said.

“The typical demographic is young, pretty well-educated, a nonfarm background. They’re coming for environmental or political reasons,” he said.

After completing an apprenticeship, many young people change their minds about farming. But about 20 percent don’t, Marshall said. Some of those apply to join the MOFGA journeyperson program, which aims to provide two years of support for prospective new farmers.

In some ways, Katz and Hazlehurst fit the typical demographic of young organic Maine farmers. Katz, who was raised in what she calls “deep suburbia,” became interested in farming through her political advocacy work as an undergraduate at the University of Vermont. She went to California to work on a farm, and there met Hazlehurst, who was from Colorado and who had studied computer science and mathematics in college.

They came east because Katz missed the East Coast, and came to Maine because of MOFGA.

“One hundred percent the reason why we came to Maine at that point was the MOFGA apprenticeship program,” Katz said.

‘It makes you appreciate Maine all the more’

Another pathway to farming in Maine is the more traditional road taken by Holly Whitcomb, 24, and Carrie Whitcomb, 28, of Waldo. The sisters grew up on the family dairy farm, Springdale Jerseys, and when their father, Walter Whitcomb, was tapped to be the new Commissioner of the Maine Department of Agriculture, Conservation and Forestry a couple of years ago, they decided they wanted to take over the day-to-day running of the farm. In general, the dairy business in Maine is not easy right now, with many small farms folding in recent years.

“Like anything, it has its challenges,” Carrie said. “Sometimes you think you’re crazy. But people are finding ways to make it work.”

Both sisters majored in dairy science at Cornell. Holly does a lot of the milking, the breeding and the hands-on working with the herd of about 200 friendly Jersey and Guernsey cows. Carrie said that her passion is for food. She has been selling meat from the farm at local farmers markets and thinking of ways to diversify the farm’s business strategy.

As the women talked about farming near the milking parlor, inquisitive brown-eyed cows came up to nuzzle them. The women have named each of the 200 or so sociable cows.

Their herd is known for the high butterfat content of the milk, they said.

Carrie said that after graduating college, she worked off the farm for four years, making cheese in New York state and near New York City.

“I got a taste of the city, and was kind of like ‘ick’ after awhile,” she said. “It makes you appreciate Maine all the more.”

Although life on a small family dairy farm means early mornings, early nights and few days off, the young women said they like their life.

“This is definitely what I want to do,” Holly said.

They also are glad to be participating in the burgeoning local food movement.

“It makes me feel like we’re becoming a part of the community,” Carrie said. “It does get a little isolating, being every day on the farm.”

‘It was an adventure’

Katz and Hazlehurst’s MOFGA apprenticeship took them to Darthia Farm in Gouldsboro, where they learned about horsepower farming. When she got pregnant with son Martin in 2006, the couple bought the former Smith Farm on a quiet country road in Troy. The family-owned farm dated back to the early 19th century, but had been lying fallow for about 30 years, Katz said. She, Hazlehurst and Martin lived in a yurt for three years because the old farmhouse had chipping lead paint and they needed to build a new, smaller home. They moved in right before she gave birth to Cora, who is now 2.

“It was an adventure,” Katz said. “I don’t recommend it to other people.”

The family now harvests tons of produce each season from the two to three acres that are planted with mixed vegetables, flowers and fruit. Much of the 160-acre farm is wooded, and they said that they were able to purchase it with family support. A farmland easement through Maine Farmland Trust did not make the land significantly more affordable, Katz said, though she declined to name a figure.

Piotti, however, said that conserving farmland can help young people trying to get into farming. Farmland often is more valuable to a developer than to a farmer, and the number of agricultural acres in Maine has dropped from 4 million in the 1960s to 1.3 million today, he said.

“The real story is we have young people in the state who want to farm,” Piotti said. “These are not just crazy, wide-eyed romantics. They’ve had some training. They understand farming is hard work. These are people who want to farm and are capable of farming. The barrier to them becoming farmers is the high cost of land.”

But Katz said she doesn’t believe there is a single solution to the challenges facing young farmers, who struggle against what she calls the “fast, cheap food culture” as well as a local market saturated by Maine’s small, organic vegetable growers.

“You have to have something special and different to make it,” she said. “I bet there are some super creative ways to tackle the local food issue.”