Carole Rothman, the artistic director of Second Stage, said the theater would be used for plays by contemporary American writers, with a particular emphasis on works by women and minorities. She said having a Broadway stage should enable the company to pay higher salaries to writers and actors, to run shows for a longer period of time, and to attract a wider audience.

“I do think there are a lot of people that should be seen on Broadway, and this will be good for Broadway,” she said. “American writers need that kind of support.”

Mr. Markinson, who has been an owner of the Hayes since 1979, said that at age 83 he was ready to move on.

“I had my run, but I’m not getting any younger,” he said. “And what I will do, instead of running a theater, I’m going back to producing. I’m very happy the sale went through and it went to them — my preference was a theater group who does good product. And I’m looking forward to seeing the new theater and will be happy knowing that I was a former owner.”

The Helen Hayes, which has been declared a landmark, is the smallest of today’s Broadway theaters, with just 597 seats. Called the Little Theater when it opened in 1912, it has been renamed several times, and will almost certainly be renamed again — Second Stage hopes to raise money by selling the naming rights.

The theater, which is at 240 West 44th Street, will become the sixth Broadway house owned or operated by a nonprofit organization. Lincoln Center Theater and the Manhattan Theater Club each has one Broadway theater, and the Roundabout Theater Company has three; the other 34 Broadway theaters are owned by for-profit companies.

Second Stage’s goals for the theater mark a return to the building’s roots: Winthrop Ames, the producer who constructed the theater, wanted it to be “an intimate house for the production of noncommercial plays that were too risky to stage in large Broadway theaters,” according to Playbill’s history of the structure.

Second Stage will be the smallest nonprofit to operate a Broadway theater. The company, with about 6,000 subscribers, currently produces six shows a year with an annual budget of $8 million; the budget would probably double with the addition of a Broadway theater. Second Stage was home to Off Broadway productions of “Next to Normal” and “The 25th Annual Putnam County Spelling Bee,” both of which transferred to Broadway; the theater’s next show is “The Way We Get By,” a world premiere by Neil LaBute.

Programming and filling the new theater will be a stretch for Second Stage. Producing on Broadway is considerably more costly than producing Off Broadway, and attracting larger audiences is a challenge: Broadway tickets are expensive, and the audiences are increasingly made up of tourists drawn to familiar titles and celebrity actors.

“It’s heavy lifting,” said Lynne Meadow, artistic director of the Manhattan Theater Club, a nonprofit which owns the Samuel J. Friedman Theater on Broadway. “But Second Stage is a wonderful theater, and more activity begets more activity.”

Second Stage officials said they expected to spend a total of $58 million on the project, of which they have raised about 70 percent, according to the company’s executive director, Casey Reitz. The money will pay not only for the purchase of the Helen Hayes building, but also for renovations and upgrades, an operating reserve and an undisclosed amount to settle the dispute with the owners over a delay in completion of the sale.

Ms. Rothman said that, in the short term, she hoped to rent out the theater to raise money while Second Stage completes the planning and permitting of its renovations, which are to be designed by David Rockwell, an architect much praised for his theatrical work. Second Stage hopes to begin renovations next year.

Shows staged on Broadway are eligible for Tony Awards — a lure for playwrights and actors — and are often more appealing to tourists and casual theatergoers. “Visibility is important, and Broadway is a very good brand,” Ms. Rothman said. “I’m happy to be part of the Broadway brand, and I think it will help us.”

Ms. Rothman said that she expected the theater would sharply discount some of its seats in an effort to diversify its audiences, and said it would also seek foundation support.

The purchase has been in the works since 2007. Second Stage announced its intention to buy the building in 2008, but the sale was delayed for multiple reasons, including the unexpected success of “Rock of Ages,” which closed in January after nearly four years at the Helen Hayes. As “Rock of Ages” closed, Second Stage sought an extension to complete its financing of the purchase; the building’s owners sought money as compensation, Second Stage sued, and a judge asked the two sides to settle the dispute, leading to the closing of the deal.

Second Stage notified its board of the sale by email late Friday, and it was first reported by Deadline.com.

Second Stage plans to continue producing theater in the two Off Broadway venues that it currently leases: a 296-seat theater on West 43rd Street and a 108-seat theater on West 76th Street. But Ms. Rothman said owning a theater would give the company greater stability; its lease on West 43rd Street expires in 2021.

A version of this article appears in print on , on Page C3 of the New York edition with the headline: Deal for 597-Seat Broadway Space Ends Dispute. Order Reprints | Today’s Paper | Subscribe