PORTLAND, Maine — St. Patrick Roman Catholic Church on outer Congress Street is a step closer to being sold to the owner of neighboring Westgate Shopping Center.

The Roman Catholic Diocese of Portland has signed an agreement to sell the church to Charter Realty & Development Corp. for an undisclosed amount, according to diocese spokesman Dave Guthro.

The sale is contingent on approvals and permits to raze the church and develop the site, a process that could require five or six months, Guthro said.

Calls to Charter were not returned by Tuesday morning.

Sale of the church at 1342 Congress St. in the Libbytown neighborhood was first proposed more than five years ago, but was rejected after opposition by parishioners.

But last fall, the diocese started considering plans to close another church, St. Pius X on Ocean Avenue.

Our Lady of Hope, the parish that manages both churches as well as a third, St. Joseph Church, approached Charter to discuss parking for the extra churchgoers St. Patrick expected to accommodate.

Charter responded by offering to buy the church for $1.35 million, according to published reports.

The proposed sale of St. Patrick comes after the diocese has closed 13 churches since 2007, and is considering a recommendation to close St. John the Evangelist Church in South Portland.

In some cases, those decisions are prompted at the local level, since parishes are expected to be self-sustaining. In other cases, the diocese has taken the lead in considering closures, Guthro said.

The diocese is also trying to sell more than 30 churches, rectories, schools and other properties it owns throughout the state.

“[The unsold properties] have added up over the course of time,” Guthro said. “They’re relatively difficult to sell, but we haven’t gotten to the point where we have to break up the properties.”

Like many organizations today, the Catholic church is facing tough economic challenges.

The diocese brought in revenues of $52.5 million in its last fiscal year, but ended up with a loss of $1.8 million, according to a diocese report. Causes include poor investment performance and declining collections from churchgoers, whose annual donations fell 2.5 percent last year and nearly 4 percent the year before.

The diocese serves a Catholic population of 187,000 throughout the state, down from 234,000 a decade ago, Guthro said.

In response to these factors, the diocese is looking for ways to increase efficiency, reduce duplication, and find new revenue opportunities, he said.

“None of this is done without a great deal of thinking,” Guthro said, “and talking one-on-one with parishioners.”

The school at the Cathedral of the Immaculate Conception, which closed in 2011, has recently attracted interest as a rental property from several parties, he said.

And in December, the diocese paid $2.75 million for its first purchase of real estate for investment purposes: a small shopping plaza at 290 Congress St., in the India Street neighborhood. The purchase drew criticism because the plaza’s anchor tenant, a Rite Aid store, sells contraceptives, whose use runs counter to church teaching.

In light of the performance of its other investments, the diocese was attracted to the plaza because of its revenue stream, as well as its location near both the Cathedral and St. Peter Parish at 72 Federal St.

Those factors “outweighed any unintended moral consequence” of owning a plaza where contraceptives are sold, Guthro said. The diocese has no plans for changing the plaza, he added.

Real estate wheeling and dealing is common in larger dioceses. But Guthro said, “It’s not our [approach]. It’s not something we’re looking to do all over the place. … It just made sense this time.

“Like any organization, we have to look at revenue opportunities. This one may not bear fruit right away, but down the road it will.”