Denmark's world number two Caroline Wozniacki has claimed she was the subject of death threats during her defeat against Monica Puig at the Miami Open ©Getty Images

World number two Caroline Wozniacki has claimed the Miami Open crowd subjected her parents to death threats during her second-round defeat to Olympic champion Monica Puig.

In a statement on Twitter, the Danish player accused those at the Crandon Park Tennis Centre of threatening her family and abusing her fiancé's 10-year-old niece and nephew.

The 27-year-old also alleged the security staff "did nothing to prevent" the threats and abuse.

"During the match people in the crowd threatened my family, wished death upon my mum and dad, called me names that I can't repeat here and told my fiance's niece and nephew (who are 10 years old) to sit down," Wozniacki wrote on Twitter.

"I hope the Miami Open chooses to take this seriously because it is a horrible example to set for the next generation of tennis players and fans."

In response, Miami Open tournament director James Blake insisted security staff "never witnessed nor were notified of any specific threats" made to Wozniacki.

"If we had been notified, the situation would have been handled immediately," Blake added.

Wozniacki lost the match 0-6, 6-4, 6-4 to Puerto Rico's Puig.

In the men's draw, unseeded Australian Thanasi Kokkinakis produced a stunning upset as he came from behind to beat world number one Roger Federer to reach the third round of this Association of Tennis Professionals World Tour Masters 1000 event. 

The 21-year-old recorded the biggest victory of his career, knocking out the top seed courtesy of a 3-6, 6-3, 7-6 triumph.

The shock defeat for the Swiss star means he will relinquish his number one ranking to Spain's Rafael Nadal.

Federer began in typically dominant fashion but the Australian qualifier gradually grew into the contest and levelled the match after dropping the opener.

Kokkinakis, the world number 175, eventually sealed victory on a tie-break in the third in an encounter which lasted for two hours and 21 minutes.

"It felt like every time I had chances something bad happened - wrong decision making by me, good decisions from him," Federer, whose winning streak this year was broken by Argentina's Juan Martin del Potro at the Indian Wells Masters earlier this month, said.

"It's disappointing, I don't know why I could never get to a level I was happy with."

Unseeded Australian Thanasi Kokkinakis produced a stunning upset as he came from behind to beat Switzerland's world number one Roger Federer to reach the third round ©Getty Images
Unseeded Australian Thanasi Kokkinakis produced a stunning upset as he came from behind to beat Switzerland's world number one Roger Federer to reach the third round ©Getty Images

Kokkinakis' reward for victory over the defending champion is a meeting with Spain's Fernando Verdasco, who overcame compatriot Guillermo García López 4-6, 6-0, 6-2.

Fourth seed Alexander Zverev of Germany is also through after he defeated Daniil Medvedev 6-4, 1-6, 7-6.

David Ferrer of Spain, the 28th seed, awaits for the German in the third round.

Elsewhere in the women's draw of this Women's Tennis Association Premier Mandatory tournament, top seed Simona Halep of Romania crashed out after she lost 3-6, 6-2, 6-3 to Poland's Agnieszka Radwańska.

The Polish player is scheduled to face Victoria Azarenka of Belarus next as she defeated 20th seed Anastasija Sevastova of Latvia 3-6, 6-4, 6-1.