A historical art foundation that claimed it had sustained nearly $6.5 million in damages and costs over a real estate deal on the Magnificent Mile waited too long to sue its former counsel, a state appeals panel ruled Friday.

For eight years, DLA Piper LLP represented the Terra Foundation for American Art — a nonprofit art group — and Terra Michigan Avenue Property LLC as it sold the site of the former Terra Museum of American Art to a developer.

In 2004, Terra closed the museum which had operated at the site since 1987. In 2005, Terra agreed to sell the museum property at 670 N. Michigan Ave. to Prism Development Co.

NM Project Co. LLC later succeeded Prism in interest.

Currently, the site is home to the Ritz-Carlton Residences as well as office and retail space.

Under the deal, Terra would own the completed retail and office parcels in the 40-story, mixed-use project developed by NM Project, while NM Project would own the residential property.

Without certainty about the ultimate square footage available for retail, the deal was set so Terra got an immediate payment that would later be adjusted up or down depending on the ultimate balance between residential and retail space.

Terra estimated it would gain another $2 million from NM Project, but at closing Terra had to pay NM Project more than $3.8 million. This loss of $6,449,619 was exacerbated by $500,000 in legal fees Terra incurred.

These losses occurred, the foundation alleged, because DLA Piper did not include certain exclusionary language in the contract with NM Project, Terra claimed. But the 1st District Appellate Court said the foundation had a six-year window from the time it executed the amended purchase agreement.

“Under the statute of repose, Terra thus had until May, 29, 2013, to file its malpractice suit against DLA, and its October 2014 complaint therefore was untimely,” Justice Mary K. Rochford wrote.

DLA represented Terra through the process.

Up front, NM Project would pay Terra $17.5 million.

The two parties set a baseline — 8,041 square feet of retail space on the first floor, 10,728 square feet on the second floor. If the final amount of retail space was below that baseline, NM Project would pay Terra $5,500 for every square foot of reduced space.

By contrast, if the final amount of space was greater than that baseline, Terra would pay NM Project the same rate for every square foot of increased space.

The two parties initially excluded areas like the lobby, elevators, loading docks and areas considered to be “back of the house.”

But when the actual purchase agreement was concluded, this exclusionary language was not included. This meant that areas like the loading dock would count toward retail space.

In May 2007, the two parties amended their purchase agreement for the first time. As part of this amendment, the two sides agreed to calculate the square footage using a method from the American National Standards Institute known as BOMA 96.

The first amendment also did not include the exclusionary language.

For the next six years, the two parties renegotiated and even went to arbitration over various aspects of the project, including the square footage of the retail space.

In January 2013, an arbitration panel ruled on what would be the final figure of the project’s retail space — 8,733 square feet on the first floor and 10,628 square feet on the second floor.

As a result, Terra owed NM Project about $3.8 million back from the upfront payment at the February 2013 property sale.

Terra sued DLA Piper for legal malpractice in Cook County Circuit Court in February 2015; however, a tolling agreement allowed the lawsuit to be backdated to October 2014.

In its lawsuit, Terra asserted DLA ignored its concerns about dropping the exclusionary language early on and adopting BOMA 96, which counted the back-of-the-house space as retail space.

In response, DLA Piper filed a motion to dismiss the lawsuit, arguing that the lawsuit was time-barred under the statue of repose.

Associate Judge Sanjay T. Tailor agreed with DLA Piper. In October 2015, Tailor found that the statute of repose began to toll in May 2007, when the two parties executed the first amendment to their purchasing agreement; the deadline to sue DLA expired in May 2013.

Terra sought to file an amended complaint to add more allegations, but Tailor denied the motion. Terra appealed.

On appeal, Terra asserted that the statute of repose should begin tolling in February 2013, the date they closed on the property.

At the very least, Terra also argued, the panel should begin counting in March 2010, which is when the parties agreed to a letter which, among other things, excluded the basement from the retail space count.

Terra also argued that, by not fixing this issue, DLA Piper’s negligence essentially kept continuing each time the parties reached a new agreement without including the exclusionary language, thus tolling the statute.

The foundation also argued that prior courts have recognized differences between alleged malpractice in a litigation setting and in a transactional setting, such as here.

But the panel found that the statute does not toll every time DLA Piper fails to correct its mistake. The statute “begins to run as soon as an event creating the malpractice occurs,” Rochford wrote, even if the client hasn’t been injured yet.

Terra pointed to a 2011 state Supreme Court case where the high court found that an attorney’s malpractice began on the last day he represented a client and that’s when the statute of repose began to toll.

But the 1st District justices indicated that this is not a stringent rule — it “should not be read to mean that, in every transaction, the statute of repose for a malpractice action begins on the last day or act of representation,” Rochford wrote.

Instead, the panel held the timeliness of Terra’s lawsuit expired in May 2013. Rochford noted that this was three months after the foundation went through with the property sale; Terra had opportunities to sue DLA Piper in a timely fashion.

The panel also rejected Terra’s arguments to amend the lawsuit. The lawsuit was time-barred, and no amendment would fix that defect, the panel found.

Terra was represented by Robert A. Chapman and Sara Siegall of Chapman, Spingola LLP. They declined to comment.

DLA Piper was represented by Martin J. O’Hara and Shawn M. Staples of Much, Shelist P.C. They did not return requests for comment.

Justices Thomas E. Hoffman and Mathias W. Delort concurred with the opinion.

The case is Terra Foundation for American Art, et al. v. DLA Piper LLP (US), 2016 IL App (1st) 153285.