A child custody investigation caused a Beijing-bound plane to turn around mid-flight and return to the Virginia airport it came from, NBC Washington reported.

Wenjing Liu and her 4-year-old son were among the 180 passengers that left Washington Dulles International Airport on Thursday afternoon.

The United Airlines flight was five hours into its journey when FBI agents ordered the plane return to Dulles on suspicion that Liu, a Chinese citizen, was violating the terms of a custody agreement by flying her son out of the U.S.

Liu is expected to appear in court Friday on charges of international parental kidnapping, the station reported. Her son was safely returned to his father, William Ruifrok III.

Ruifrok, who is American, separated from his wife Liu last year. The parents had joint custody of the child, but according to the custody agreement, neither parent was allowed to take the child outside the U.S. without the other's consent.

Liu sent her estranged husband an email saying her grandfather was dying and she was taking their son to China, investigators told NBC News. When Liu ignored Ruifrok's objections, he notified FBI about the potential kidnapping.

Passengers said the pilot initially told them they had to return due to mechanical issues, CBS News reported.   

"After they left, the pilot came back on and said that he deliberately misled us, he thought that, in his judgment that it was the best thing to do, given the circumstances of potential abduction that that's the reason we had diverted," passenger Lane Bailey told the station.

Flight 897 continued on to its destination Thursday evening.

The plane was flying in Canadian airspace when FBI ordered its return. If the flight landed in Canada or China, the situation could have turned into a nasty, international custody battle, according to CBS News.