PROVIDENCE, R.I. — Wary of tax increases, weary of layoffs and determined to avoid bankruptcy, Providence Mayor Angel Taveras had only to gaze up at his city’s Ivy League campus to see a way out of the morass.

On College Hill sits Brown University, with a $2.5 billion endowment and property worth an estimated $1 billion. Brown would pay the city $38 million in property taxes each year — more than enough to solve the city’s budget problems — if only it wasn’t tax exempt.

And so city officials and state lawmakers applied some pressure to the university, and last week Brown agreed to contribute $31.5 million to Providence over the next 11 years. The money comes on top of nearly $4 million that Brown already voluntarily gives the city every year.

Story continues below advertisement.

The town-vs.-gown confrontation reflects a trend across the nation as cities desperate for revenue try to get more money out of tax-exempt institutions such as universities and hospitals.

These institutions argue they already contribute to a city’s economy and quality of life through jobs, economic activity and community services. But as cities grapple with deficits and cash-flow crunches, they are succeeding in getting nonprofits to pay up.

“It’s about all of us trying to help the city and the state grow,” Taveras said. “If we want to see Rhode Island succeed, we will never get there without Brown.”

David Thompson, vice president of public policy at the National Council of Nonprofits, wryly calls such agreements “mandatory volunteerism.”

“It’s ‘We need money, you have money, and we’re going to pressure you to do this unless you give us a voluntary payment,'” he said.

Baltimore officials, for example, threatened to tax hospital and university dorm beds before Johns Hopkins University and other tax-exempt institutions agreed to make contributions.

Boston, with one of the biggest concentrations of colleges, universities and research centers in the country, collects significant amounts of money from such institutions. Harvard, Boston University, Massachusetts General Hospital and several other institutions made $34 million in payments in lieu of taxes in 2010 in what the city says is the biggest such program in the nation.

In Lancaster, Pa., the city sends out letters every year asking nonprofit organizations to pay one-third of what would have been their tax bill. Lancaster General Hospital pays more than $1 million voluntarily, more than its taxes would have been, Mayor Rick Gray said.

“They said they feel they should be supportive of the community,” he said. “We’re certainly grateful.”

Brown has enjoyed a tax exemption since colonial days but decided to kick in more money because it sees itself as a partner in Providence’s economy and because it wants good relations with the city, said Brown University President Ruth Simmons.

“The idea that we have an endowment, a budget that will bear these kinds of costs is not correct,” she said. Still, she said, it was obvious that this was “a time that requires we step up.”

The use of payment-in-lieu-of-tax deals is on the rise. Such agreements have been carried out in at least 18 states since 2000, mostly in the Northeast, according to a study by the Lincoln Institute of Land Policy.

City leaders say it is a matter of fairness to taxpayers. As universities and other tax-exempt organizations expand, they consume more city services while taking property off the tax rolls.

Syracuse, N.Y., Councilman Patrick Hogan said hospitals in his city have recently embarked on big expansions, as have Syracuse University and another college.

“They’ve gobbled up property that used to be taxable,” he said. “That just moves the burden of paying for fire protection, police, garbage collection and everything else onto the remaining taxpayers. I’m just saying it’s time for them to kick in a little more to support these services.”

Hogan said the city may have to tax commuters if the nonprofits don’t agree to pay more.

Cities have found other ways of generating money from tax-exempt organizations. Chicago, for instance, recently announced it would begin charging nonprofits a water fee.

Religious organizations and small charities are also tax-exempt, but there is little talk of targeting them for contributions. Going after churches is a political non-starter, and nonprofit community organizations don’t have much money to offer.

Providence couldn’t afford to make adversaries of universities and health care providers — two growing sectors seen as the state’s best hope for reversing years of rising unemployment and economic stagnation. Rhode Island’s unemployment rate in March was 11.1 percent, or 3 percentage points higher than the nationwide level.

Brown had no legal obligation to contribute more but was facing significant political pressure in the Statehouse, where lawmakers were considering legislation that would authorize cities to require payments in lieu of taxes from tax-exempt institutions.

Simmons noted that Brown is one of the city’s top employers. Students spend money in Providence businesses. Research discoveries spur economic development. The Ivy League school burnishes the city’s national reputation. The mayor himself calls Brown “our major league franchise.”

But “it is simply unfair to ask our residents and businesses to pay more and more in taxes each year, while preserving a 250-year-old special privilege for an organization with a $2.5 billion endowment,” City Councilman John Igliozzi said in January, when he introduced a resolution calling on the state to remove Brown’s blanket property tax exemption.

Taveras went with a softer approach, asking the city’s largest tax-exempt institutions to help close a $22.5 million deficit that he warned put the city on the brink of bankruptcy.

Johnson & Wales University agreed to triple its annual voluntary payments to $958,000. A big health care provider decided to kick in $800,000 annually for three years.

Rhode Island House Speaker Gordon Fox said Brown’s help in staving off bankruptcy for Providence won’t be forgotten.

“Brown does add value,” he said with a smile on the day the deal was announced. “Today, it adds a little more value.”