J.B. Brown & Co. has purchased MaineToday Media’s printing plant in South Portland and will lease the building back to the company, which publishes the Portland Press Herald/Maine Sunday Telegram.

The deal was announced Tuesday by CBRE | The Boulos Co., which handled the transaction.

The lease-back of the building at 295 Gannett Drive runs for an initial term of 10 years, renewable for up to 40 years, said Lisa DeSisto, chief executive officer and publisher of MaineToday Media.

“This sale allows us to … invest in the future of our company,” DeSisto said in an email informing employees of the sale.

A party to the transaction said the price of the building and the 21 acres surrounding it was $4.9 million. The building was assessed at $9.9 million and the land at $2.2 million, according to South Portland assessment records.

MaineToday Media will use the sale proceeds to buy a printing press for the facility that will be less expensive to operate than the current machinery, DeSisto said. The company also prints the Kennebec Journal, (Waterville) Morning Sentinel and Coastal Journal at the plant, all sister publications of the Press Herald/Telegram.

Shedding real estate has become a trend in the newspaper industry. Papers such as The Washington Post, the Miami Herald and the New York Daily News have all left buildings that they have owned for many years to move to rented offices that are cheaper and better equipped for digital operations.

MaineToday Media plans to move almost all of its remaining staff – including reporters and editors who currently occupy leased space at One City Center in Portland – to the South Portland building, once a sublessee is found. The advertising, circulation and support staff moved to Gannett Drive last year. The company also is negotiating with its unions, the News Guild of Maine and the Teamsters, over staffing the printing operation in South Portland.

Vincent Veroneau, president and CEO of J.B. Brown & Sons, said the 21-acre South Portland site has the potential for development, but there are no immediate plans for additional buildings.

From 1922 to 2010, the newspaper company’s headquarters were at 390 Congress St. in Portland. From 1966 to 1988, the Portland newspapers, which at the time included the Portland Evening Express, were printed across the street at 385 Congress St. The $40 million printing plant in South Portland was opened in 1988.

The downtown buildings were sold in 2009, when the papers were purchased from The Seattle Times Co. by a group of investors led by Richard L. Connor. The 390 Congress St. building has since been converted to The Press Hotel, but the 385 Congress St. building has yet to be redeveloped.

Connor sold a controlling interest in the newspapers to S. Donald Sussman in 2012, and the papers were sold to Reade Brower of Rockland last June.