Apple violated a local consumer law by giving a refurbished iPhone with used components as a replacement for a new one that was not working properly, a Danish court has said.

Consumer David Lysgaard "had a legitimate expectation" to receive a new product, Glostrup City Court said, adding that the replacement smartphone "can't be qualified as a brand new phone".

Under Danish consumer laws, a dysfunctional and unfixable product should be replaced with a new equivalent product or the money should be refunded.

The court of law said that Mr Lysgaard had the right to declare the purchase voided and get his money back after several complaints about problems with his iPhone 4, which he bought in June 2011.

Apple sued Mr Lysgaard after losing a 2014 ruling by Denmark's Consumer Complaints Board.