LOS ANGELES — Crystal Cathedral Ministries, known for the towering Orange County megachurch where “Hour of Power” is taped, has agreed to sell its campus to a real estate investment group as part of a plan to emerge from bankruptcy.

The real estate group, Greenlaw Partners, is paying $46 million for the property — almost exactly the same as the amount that the Crystal Cathedral owes its creditors. The sale will allow the church to “immediately eliminate” most of its debts, while continuing religious services at its current location and broadcasts of “Hour of Power,” according to church officials.

“We are pleased that we are able to honor the debt,” Sheila Schuller Coleman, the church’s senior pastor, said in a statement. “To pay them back 100 percent has always been a top priority, and we are grateful to God for providing the resources to be able to do just that.”