Madonna has lost a nearly three-year-old legal battle against her Manhattan co-op over a rule that requires her to be physically present in the $7.3 million pad when any of her family members or staff are there.

The Queen of Pop sued Harperley Hall on West 64th Street and Central Park West in April 2016, two years after the board changed the building rules to say that her children and domestic help cannot live in the unit unless she herself is “in residence” at the time.

“Plaintiff is a world-renowned recording artist, performer and singer who is constantly on world tours,” the “Like a Prayer” singer argued in court papers.

But Manhattan Supreme Court Justice Gerald Lebovits was not swayed. He first ruled in September 2017 that she missed a legal deadline to challenge the rule.

Now the judge has nixed Madge’s remaining demands for documents from the board and attorneys fees.

Madonna said she wanted the documents “so she can protect her children so that they can live in Unit 7A as a family.”

The board characterized her demand as “merely fishing for materials in an attempt to substantiate an otherwise time-barred challenge to board action affecting her personal interests.”

In a ruling made public Wednesday Justice Lebovits found the board had already provided Madonna with sufficient information– namely with a list of shareholders and minutes of the 2013 and 2014 annual meetings.

Reps for Madonna and the board did not immediately return requests for comment.