The world No 1 had just dropped his serve to trail opponent Pablo Carreno Busta 6-5 in the opening set of their fourth-round match on Arthur Ashe Stadium.
He hit a ball behind him in frustration and it struck a female line judge. After the ball was struck, it was immediately clear that she was hurt and the Serb rushed over to check on her condition.
Tournament referee Soeren Friemel came out on to the court and spoke to chair umpire Aurelie Tourte and Andreas Egli, the Grand Slam supervisor, before a lengthy discussion between tournament officials and Djokovic.
He pleaded his case at length before accepting his fate, collecting his rackets and walking off the court.