PORTLAND — Maine’s highest court has upheld a lower-court ruling that exempts certain properties at Hebron Academy from property taxes even though they’re rented for outside use.

Nonprofits were closely watching the case about whether Hebron Academy, a private boarding school, must pay property taxes on facilities it rents to outside groups.

Bryan Dench, an attorney representing the town, argued the school had crossed the line from nonprofit into for-profit. He said the school’s website solicits wedding parties and other events, showing pictures of brides on campus.

“Perfect for parties large or small, Hebron offers savory cuisine and a beautiful, expansive setting,” the site reads, listing virtually all campus spaces, from a climbing wall in the gym to dormitories and dining halls for summer conferences.

“When you go into business, as Hebron has, you have a problem,” Dench argued in court.

But the Maine Supreme Judicial Court said that the rental use of the properties doesn’t detract from their primary use as educational facilities, according to the Associated Press.

The Supreme Court upheld a lower court’s ruling that the private boarding school was a “literary and scientific” institution and that most of its real estate was exempt from local property taxes.

In oral arguments in December, much the of arguments revolved around the school’s ice rink.

John Conway, the attorney for Hebron Academy, argued the revenue is “incidental,” considering that the school takes in about $30,000 a year on rink rentals while the annual operating cost is about $370,000.

“Almost all of (the annual revenue) is less than the cost of operating (the rink),” Conway told the justices.

But Dench argued $30,000 is not “an unsubstantial amount.”

National nonprofit executives say the case illustrates how cash-strapped municipalities are increasingly seeking revenue from hospitals, schools, churches and other tax-exempt organizations.

“This is happening all over the place,” said Jennifer Chandler, a vice president of the National Council of Nonprofits, based in Washington, D.C.

Hospitals and colleges, with large facilities and campuses, are particularly tempting targets, she said.

State and municipal governments “are looking everywhere,” she said, “including to the charitable community, for revenue, ignoring the historic and valuable partnership that exists between government and charitable nonprofits.”

Some cities are exploring payments in lieu of taxes from nonprofits that have large endowments or pay executives hefty salaries, indicating that they can afford to pay some taxes.

In Portland, MaineHealth makes payments in lieu of taxes for some of its property. The city still loses considerable revenue: In 2011, nearly $1 billion of the city’s $7 billion tax base was owned by private, tax-exempt organizations including hospitals, colleges, schools, churches, museums and social service agencies, according to city data.

Several groups representing private schools, colleges and hospitals filed briefs supporting Hebron Academy.

“The tax-exemption is fundamental to the ability of nonprofit colleges and universities to provide affordable access to higher education and community benefits in the form of jobs, cultural activities, recreation, and other contributions,” said a statement from Bates College in Lewiston.

Janet Mills, Maine’s attorney general, also filed a brief in support of the school, saying, “A decision to so narrowly construe the exemption as to disallow incidental rental income for qualified institutions would inflict a major blow to the viability of these historic educational institutions.”