Townsend and Pepperell were both ranked among the top 25 fastest growing towns in the state for home sales last quarter.
According to a list published by McGeough Lamacchia Realty, and based on data provided by the Warren Group, Townsend had the third largest increase in the number of home sales, while Pepperell placed ninth in the state.
Only towns with a minimum of 25 home sales for the quarter were included on the list.
All the towns in the top 25 have three factors in common, according to the list -- good schools, green space and proximity to highways.
Growth is also up statewide. According to Tim Warren, CEO of The Warren Group, that growth may have to do with a sudden increase in demand as the economy improves.
"I think there's a lot of pent-up demand for people who would have ordinarily purchased a home but were too scared to do it two or three years ago. Now they are out in force looking and finding quite a lot of competition," Warren said.
In Townsend, 41 homes were sold last quarter, marking an increase of 95 percent over the same quarter last year.
Those homes were sold for a median price of $224,500, an 18 percent increase over the same period in 2012.
The ranking highlighted Townsend's state forest, historic architecture and the town common as reasons for its appeal.
Niles Busler, co-owner of Squannicook Associates Real Estate, said that Townsend's competitive prices gave it a leg up on other towns.
"Townsend had quite a lot of inventory and the prices had not leveled off yet," he said. "I think that, in terms of the number of sales, we have become a hotspot because we were competitive with other communities. You can get a better bang for your buck in Townsend, and people see it as a progressive community. I believe that it's probably going to get better as time goes on."
Pepperell also appeared in the list last quarter, at eighth.
Although it fell one spot on the list this quarter, its 43 home sales put Pepperell at a 65 percent increase from last year.
Median home prices also rose 34 percent to $270,000.
"Pepperell is a quiet community that is dedicated to preserving its history and character," the report says, citing the Nashua River Rail Trail as one of the town's attractive features.
Realtor Dean McMillin, of Pepperell's Nice Place Properties, said Pepperell has many features that would make it attractive to potential homebuyers.
"The community is a typical, small New England town, and the demographic here is very attractive to a large number of people. We have both blue-collar and white-collar workers here. People that live in the town are fairly well educated and so the school system is fairly up to date in terms of facilities, and the teacher-to-student ratios are conducive to attracting people to the community," McMillin said.
Although not ranked in the top 25, other towns in the Nashoba Valley also saw increases in home sales.
Sales in Shirley increased 47.8 percent over this period, and sales in Groton increased 22 percent.
Harvard and Ayer also recorded slight increases, at 8.7 percent and 3 percent, respectively.
Follow Chelsea Feinstein on Twitter and Tout @CEFeinstein.