Despite some missteps and a last-minute snag, a developer signed a contract yesterday to take control of the 110-story World Trade Center complex in a deal worth $3.2 billion, the largest real estate transaction in New York history.

The completion of the deal is the end of an effort begun three years ago by Gov. George E. Pataki of New York and Christie Whitman, then the governor of New Jersey, to privatize the huge 10.6-million-square-foot office complex. It was built 30 years ago by the Port Authority of New York and New Jersey to stimulate development in Lower Manhattan. The governors pledged to use the proceeds from the transaction for new transportation projects.

A group led by Larry A. Silverstein, a developer, and Westfield America Inc., an owner of shopping centers, signed a 99-year lease yesterday after working nearly 24 hours straight on the agreement. Still, the Port Authority delayed the start of its board meeting yesterday afternoon until the developer delivered a $100 million letter of credit, the first installment on a $616 million down payment. The group will then make annual rent payments to the Port Authority, manage and lease the complex and spend $200 million on capital improvements.

In recent weeks, the deal was beset by a series of problems -- ranging from the enormous difficulty of structuring such a complex deal within a short time to the sudden slowdown in the economy -- that scuttled negotiations with one bidder and nearly toppled Mr. Silverstein.