Sony has agreed to sell its 37-story US headquarters on Madison Avenue in New York City for $1.1 billion, in a move that should generate about $770 million in cash for the struggling electronics firm after repaying debt tied to the building and other transaction costs. The deal is expected to close by the end of March, and is part of a broader initiative to end four straight years of losses by selling assets and cutting jobs.

The buyer is a consortium of investors led by the New York-based Chetrit Group, which also own the Willis Tower in Chicago. As part of the deal, Sony's businesses including Sony Music Entertainment and Sony Pictures Entertainment will continue to rent and use the space for at least three more years.

The sale agreement represents a big gain for Sony, totaling more than four times the $236 million it paid for the property in 2002 when it purchased the building from AT&T. The company is rumored to be seeking a similar deal for its new building in Tokyo. According to a report by Reuters earlier this month, Sony has put one of its main buildings in the Japanese city up for sale in a deal that could raise as much as $1.14 billion.

Getting rid of non-core assets is just one of a series of cost cutting initiatives under new CEO Kazuo Hirai. In October 2012, the firm announced it would trim 2,000 jobs and close a Lens factory in Japan, while earlier in the year it had announced plans to reduce its global headcount by 10,000.