SHANGHAI — Nick Kyrgios was fined $31,085 by the ATP on Wednesday after walking off the court during his opening match at the Shanghai Masters a day earlier.

The 13th-seeded Australian packed his bag and left the court after losing the first set 7-6 (5) to Steve Johnson on Tuesday.

Kyrgios was fined $21,085, his first-round prize money, for failing to see the doctor following his retirement. According to ATP Tour rules, it is mandatory to be examined by a physician if injured. He was fined an additional $10,000 for unsportsmanlike conduct.

Hours after he abandoned the match, Kyrgios offered an apology on Twitter and said he had a stomach ache and sore shoulder.

Kyrgios received a warning during the 12th game of the first set after hitting two balls in anger. During the tiebreaker, he was docked a point for inappropriate language.

Kyrgios has also withdrawn from the double tournament.