A D.C. Superior Court judge Monday approved the Corcoran Gallery of Art’s controversial plan to merge into the National Gallery of Art and George Washington University. The ruling terminates the independence of Washington’s oldest private art gallery and a venerable art college but opens a future in which proponents contend that the artworks and students will be better served by more financially stable caretakers.

The ruling makes official an outcome that leaders of the three institutions have been forced to plan on anyway, given that the new school year opens with orientation Wednesday. Corcoran executives also maintain that the institution was on the edge of having to close altogether.

“It’s quite a relief because the alternative was too painful to consider,” said Peggy Loar, interim director and president of the Corcoran. “Because of the timing of all this, we didn’t have the luxury of waiting.”

In the next few years, Corcoran students will pay the same tuition and take similar classes from many of the same professors, albeit under GWU management. New curriculums, higher prices and closer integration with the university are likely to be phased in over time.

Meanwhile, curators from the National Gallery of Art (NGA) and the Corcoran will continue taking inventory and planning for transferring the 17,000 artworks.

“I realize it’s come out of a long, complicated and difficult time in history,” said Earl A. “Rusty” Powell III, director of the National Gallery. “I think the solution saves the collection for Washington. It saves the school and moves it into a great university.”

In his 49-page opinion, Judge Robert Okun held that it is not impossible but it is “impracticable” for the Corcoran to operate in its familiar form of the past 145 years. Instead, Okun wrote, the proposal to give much of the Corcoran’s art to the NGA and to turn over the Corcoran College of Art and Design to GWU is the best solution to the Corcoran’s long-standing financial crisis. It is also the closest alternative to carrying on the mission established by financier William W. Corcoran in 1869, the judge wrote. The court’s approval was required in order to revise William Corcoran’s original deed of trust.

“This court finds it painful to issue an order that effectively dissolves the Corcoran as an independent entity,” Okun wrote. “But this court would find it even more painful to deny the relief requested and allow the Corcoran to face its likely demise — the likely dissolution of the college, the closing of the gallery, and the dispersal of the gallery’s entire collection.”

Sounding torn, Okun added that “the question is a close one, about which reasonable minds could differ.”

The decision was a victory for Corcoran Chairman Harry F. Hopper III and his board of a dozen trustees who, in 2009, embarked on a methodical search for a sustainable path for the institution. At the time, Hopper testified during a seven-day evidentiary hearing, the Corcoran was in default to creditors, on the verge of missing a payroll and at risk of closing altogether. Over the past six years, to cover $26 million in losses, the Corcoran cannibalized $9 million from its endowment and “borrowed” millions more from restricted accounts, promising to pay back the money from sales of real estate and other one-time windfalls.

“We are gratified by the court’s decision,” Corcoran attorney Charles Patrizia said in a statement. “It assures that the Corcoran’s collection will be preserved, the College will be strengthened, and the Corcoran’s landmark Beaux Arts building will be restored, with exhibitions of contemporary art continuing.”

A band of Corcoran students, faculty, staff and other supporters — members of the advocacy group Save the Corcoran — advocated keeping the Corcoran intact and independent. They said that Corcoran leaders overstated the financial plight and failed to address it with more aggressive fundraising and a stronger vision for the future.

A consolation for that group, even in defeat, was that its extraordinary effort to mount a challenge in court afforded a public platform for a sober critique of Corcoran leadership and for the consideration of alternative visions. Until Okun granted the group standing in the matter last month, the trustees’ plan had been on track to be presented to the judge without opposition.

“While this is not our vision for the Corcoran, we received a full and fair trial and are grateful that we were given the opportunity to defend the legacy of one of the oldest and most beloved museums in the nation,” Andrew Tulumello, attorney for the opponents, said in a statement. “We wish GWU and the National Gallery all the best as the new stewards of Mr. Corcoran’s gifts.”

Some Corcoran students worry that the unique identity and close-knit feel of the Corcoran will be diluted within the much larger university, said Corcoran Students’ Association President Camila Rondon.

“Right now, I’m just thinking of the student body and how we can stay strong and keep our traditions alive,” she said. “Now I think the Corcoran student body needs to accept what has happened and move forward.”

Rondon said her thoughts are also with the art, which includes a world-class survey of American painting, as well as important holdings of photography and contemporary art. “It’s such an amazing collection, and it’s going to be hard to see it go,” she said.

Powell challenged the notion repeated in court that the NGA will merely “cherry-pick” the best of the Corcoran’s pieces, with little concern for the rest. He said that “certainly” more than half the art will wind up with the NGA. Washington nonprofit artistic and educational institutions will have priority to receive the rest.

The Corcoran’s galleries will close Oct. 1 for extensive renovations, while the college portions of the building will remain open under GWU management. The renovations will address vital maintenance problems, expand the classroom and studio space, and spruce up the exhibit areas.

Powell said he is aiming to reopen the galleries by Oct. 1, 2015, with the NGA presenting shows of contemporary art and a “legacy” gallery of works associated with the Corcoran. But much less of the building will be devoted to showing art: The NGA’s 14,000 square feet of galleries — to be located in the premier sky-lit salons on the second floor around the soaring atrium — will amount to less than 40 percent of the Corcoran’s current exhibit space.

Loar said the expanded education space and reduced exhibit space is a reasonable trade-off.

“It’s better to get one right and do something more interesting with the other,” she said, adding that the NGA has the resources to put on groundbreaking international shows and do a better job conserving the art.

In court, the opponents argued that the Corcoran could thrive independently with better management, and they suggested alternative plans that might have kept the school and gallery together. The alternatives included suggestions from philanthropist Wayne Reynolds and the University of Maryland.

Okun, however, said in his opinion that he thought the opponents were too “optimistic” in predicting the success of the alternatives. He also questioned whether the partnership with U-Md. or the “center for creativity” advanced by Reynolds were any closer to William Corcoran’s original vision than the arrangement with the NGA and GWU.

The Corcoran’s periodic crises — including sporadic breakdowns and patching of systems in the landmark building near the White House, the 1989 cancellation of a daring Robert Mapplethorpe show, and the 2005 collapse of fundraising for an addition by Frank Gehry — have anguished and sometimes appalled the art world for decades.

In June 2012, Hopper announced that the board was considering selling the building and searching for more affordable, flexible space — even in Alexandria, if necessary. That idea was shelved, but there followed serial courtships of potential partners or saviors, including Reynolds and U-Md. and finally — for the second time in a year — the NGA and GWU.