The parent of Strayer University  and Capella Education Co. announced Monday they plan to merge, with headquarters being in Virginia.

Strayer Education Inc. and Capella Education Co. announced Monday they are merging, in a $2 billion deal that will make the combined company one of the largest for-profit college operators in the country.

Shareholders in Herndon, Va.-based Strayer will own 52 percent of the combined company’s stock, while Capella investors will hold the rest. Both boards have voted unanimously for the deal, which the companies anticipate will close in the third quarter of 2018. They will need state and federal approvals, including a thumbs up from the Department of Education.

The agreement arrives as for-profit schools continue to struggle with volatile enrollment and regulatory uncertainty. While the Trump administration has relaxed many rules targeting the sector, Democratic state authorities continue to go after for-profit colleges for abusive sales and marketing tactics.

Neither Strayer nor Capella has endured the legal headaches of some of their competitors, yet tepid growth in the number of people seeking degrees remains a hurdle — but one that investment analysts say the combined companies may be able to overcome.

“Combining two of the highest-quality names within the sector could enhance the competitive positioning of the new enterprise, allowing increased and more focused student recruitment efforts, potentially driving improved enrollment growth,” Peter P. Appert, a managing director at Piper Jaffray & Co., wrote in a research note on the merger.

Strayer University and Capella University will maintain their separate leadership, faculty and academic support services, though they will combine technology, accounting and other back-office services. The schools also plan to share education models like Capella’s competency-based degree programs, which allow students to learn at their own pace and move along as they have mastered the material. Together, the universities will serve about 80,000 students across the country.

“It’s likely that we’ll both have some jobs impacted through the combination of these functions, but it’s also true that we’ll be adding positions,” Strayer chief executive Karl McDonnell said, on a call with analysts Monday.

Once the deal is closed, McDonnell will become the chief executive of the combined entity, which will operate under the Strayer corporate banner and be headquartered in Herndon, Va. The newly formed company will maintain a significant presence in Capella’s hometown of Minneapolis. Capella chairman and chief executive Kevin Gilligan will become vice chairman of the new company, while Strayer’s executive chairman Robert S. Silberman will serve in the same role for the combined business.

Founded in 1892, Strayer offers certificates and degrees through its online operations and campuses. The company has experienced a 63 percent surge in its shares in the past year and has a market value of roughly $1 billion. Strayer reported a 7 percent increase in new enrollment in the third quarter, bringing its total student body to 41,679 students.

While Strayer does provide graduate education, Capella, which opened its doors in 1991, has a more robust offering of advanced degrees. Nearly three-quarters of Capella’s students were pursuing master’s or doctoral degrees at the end of June, according to the company. Capella has not fared as well as Strayer in the markets. The company’s stock fell 7 percent in the last year.

“Strayer and Capella complement each other in powerful ways,” Gilligan said, in a statement. “Uniting Strayer University’s degrees in business . . . accounting, economics and information technology with Capella University’s competency-based flexible degree programs, health care offerings and robust doctoral portfolio will help us better meet the educational needs of students in the modern economy.”

The companies anticipate the merger will result in an annual cost savings of about $50 million through the consolidation of certain corporate functions, marketing and technology operations.

“The cost benefits of achieving larger scale are clear and could translate into further sector merger and acquisition activity,” Piper Jaffray’s Appert said. Still, he doesn’t believe this transaction will trigger a “flood of industry consolidation.”