Madonna has lost a legal battle to prevent the auction of personal items including a lock of her hair, her underwear and a breakup letter from former boyfriend, the late rapper Tupac Shakur.

The singer won a temporary block of the auction of 22 pieces in July 2016, telling a New York City court that her celebrity status “does not obviate my right to maintain my privacy, including with regard to highly personal items”.

In a decision made public yesterday, judge Gerald Lebovits ruled that she had misdirected her legal action by targeting Darlene Lutz, the New York art collector who helped Madonna build a collection before the pair fell out.

Lebovits sided with Lutz, who claimed that the pair’s disputes had been settled in a 2004 legal agreement. The judge questioned why Madonna had pursued Ms Lutz rather than her own assistants, who Madonna claimed gave her possessions to the dealer. Lutz’s lawyer, Judd Grossman, called the decision “a total win”, saying: “Ms Lutz is now free to do with her property as she pleases without any continued interference by Madonna.”

Madonna is yet to comment on the ruling.

Facebook Twitter Pinterest ‘I never meant to hurt you’ ... Madonna and Tupac in March 1994. Photograph: Patrick McMullan/Getty

Auction house Gotta Have Rock and Roll has said it would continue with the sale of the items in July. In a statement, the organisation said it had been confident about the case and undertaken “substantial due diligence” before announcing the initial auction.

Madonna and Tupac began dating in 1994. In the handwritten letter included in the auction, obtained by TMZ and dated 15 January 1995, the rapper says that his image would suffer from him dating a white woman. He expressed his discomfort with an interview in which the musician said: “I’m off to rehabilitate all the rappers and basketball players.”

Madonna and Grimes lay bare cost of creative freedom for female artists Read more

“Can u understand that?” he wrote. “For you to be seen with a black man wouldn’t in any way jeopardise your career. If anything it would make you seem that much more open & exciting. But for me at least in my previous perception I felt due to my ‘image’ I would be letting down half of the people who made me what I thought I was. I never meant to hurt you.” The rapper died in 1996, aged 25, in a drive-by shooting in Las Vegas.

The auction contains a second letter, sent from Madonna to “J”, in which she describes Whitney Houston and Sharon Stone as “horribly mediocre”.