Maine has a problem: a lack of youth. At 44, Maine’s population has the oldest median age in the country. The national median age is 39. But while Maine is popular among tourists, it doesn’t attract young adults, and particularly not young professionals.

“The employer community spoke out loud and clear that even if 100 percent of college graduates in Maine chose to stay here and work, that still [wouldn’t] fulfill our workforce need,” said Nate Wildes, engagement director for private-sector initiative Live+Work.

Back in 2008, Live+Work helped to begin a retention program for those college grads: if they remained in state, living and working in Maine, the Educational Opportunity Tax Credit program allowed them to use their student loan payments as tax credits.

Here’s an example: If you pay $1,400 towards your student loans in a year, and in the same year you owe the state $1,500 in income tax, you only wind up having to pay the state $100. And for STEM majors only, there’s an additional perk: If you owe the state only $1,300 in income tax, you get the difference back as a check.

The program quickly became attractive to out-of-state talent too; Maine is now seeing a small but growing influx of young professionals moving to the state to take advantage. Some work in their fields of study, some don’t, but they are all becoming invested in the state’s economy.

This is a substantial financial investment by the state, many millions of dollars,” said Wildes in an interview with CNN. “The message to employees is: We appreciate all you’ve done to invest in yourself, we’d like to put that talent to work and award you by not only giving you a job but by alleviating your student debt.”

So far, it is the only statewide debt relief program of its kind, and perhaps the most generous tax relief program in the country aimed at student loans.

“In that perspective, Maine is light-years ahead,” Wildes said. “It’s by far the most general universal tax relief program in the United States.”