The Blimpie submarine sandwich shop in Weslaco, Texas, provides more than just a quick lunch.

It also raises money for Affordable Homes of South Texas, Inc., (AHSTI), and brings jobs and new economic activity to its small town just a few miles from the Mexican border. “We always talked about doing some economic development work and some job training,” says Robert Calvillo, executive director for the nonprofit corporation.

Calvillo knew that his organization couldn't continue to meet the demand for affordable housing by relying on traditional funding sources, so he got creative. His group bought a corporate franchise, with profits from the sandwich shop helping fund its housing developments.

The Blimpie shop opened in May in 1,500 square feet of retail space owned by the nonprofit. By the end of this year the franchise will contribute more than $20,000 to the nonprofit’s work of building affordable housing, even though it has only been open for two-thirds of the year.

“It’s doing very, very well,” says Alan Crites, area developer for Blimpie. The franchise is succeeding even though it’s located far from the big box retail stores on high-traffic roads that make up most of the economic life in its area.

Instead AHSTI’s Blimpie shop is in downtown Weslaco, within walking distance from a number of potential customers, including a nursing school across the street. The franchise should make even more money in 2014 as it expands its catering business to customers like Weslaco’s City Hall, the fire station, and the school system. The franchise has already scheduled several large catering orders for the beginning of next year.

Civic-minded customers are attracted by AHSTI’s mission of community development. Blimpie allowed the franchise to customize its advertising, which has to be approved by the corporation, to include the tagline “Great Food for a Great Cause.”

The $20,000 the shop contributes to AHSTI will be a pure dividend. It doesn’t include operating expenses such as the $1,000 in rent the franchise pays every month to AHSTI. It also doesn’t include the monthly repayment of AHSTI’s $200,000 investment in the sandwich shop, which includes a $5,000 franchise fee to Blimpie and a lot of contracting work to build out the space. The operating budget for the shop also pays for five employees, providing some much-needed employment for the small town.

To create a Blimpie franchise without threatening its own status as a nonprofit, AHSTI created a web of legal entities to separate the two, including a C-corporation that owns a  limited liability company that owns the franchise. Blimpie usually asks its franchise owners to make themselves legally liable for the potential cost of failure at their shops. AHSTI created a $25,000 fund to cover that unlikely event.

The shop is just one small piece of AHSTI’s activities. The nonprofit builds and sells 100 to 120 homes a year to low-income families. That makes the nonprofit the largest homebuilder in Hidalgo County—where single-family homeownership is still king, despite low average incomes. With 45 employees in three offices, AHSTI provides homebuyers with financial literacy training and also provides home loans, holding a loan portfolio of about 2,000 home loans totaling $45 million. AHSTI has more than 1,600 low-income families on its waiting list.

In the past, grant money helped lower the sale prices of AHSTI’s homes. But federal HOME and Community Development Block Grant funding for AHSTI has fallen from $3 million a year to roughly $500,000 this year. Funding from charity foundations has fallen from as high as $100,000 a year to around $50,000. A few thousand dollars a year from AHSTI’s Blimpie franchise can’t make up for all this lost funding—but it still helps.

Calvillo spent hundreds of hours of his own time getting the franchise started. He even attended “Blimpie University,” a week of training for franchisees in Scottsdale, Ariz. He hopes that investment will pay off as AHSTI opens other Blimpie franchises in the future.

Blimpie would also be happy to open another franchise with an organization like AHSTI, says Crites. It turns out nonprofit affordable housing developers can make great franchise owners. “They bring an organizational skill that we look for in a franchisee. They bring a motivation that we look for,” says Crites.