A 14-year-old boy traveling as an unaccompanied minor was placed on the wrong flight on Sunday night.

He was supposed to travel to Stockholm but was placed on a plane heading to Düsseldorf, Germany.

He was allowed off the aircraft but missed his correct flight and was rerouted through Copenhagen, Denmark.

The boy's mother said the issue began when United asked her to pay extra to register her son as an unaccompanied minor, meaning her son was escorted by United staff onto the wrong plane.

United says it does not allow travelers to register as unaccompanied minors when a transfer to a partner airline is involved.

Visit Business Insider's homepage for more stories.

A 14-year-old boy from Raleigh, North Carolina, flying as an unaccompanied minor endured an all-night ordeal after United Airlines directed him onto a plane heading to the wrong country.

Brenda Berg, the boy's mother, first tweeted to United just before 5:30 p.m. on Sunday, saying her son was placed on the wrong plane during a transfer at Newark Liberty International Airport.

Berg said her son was flying from Raleigh-Durham International Airport, connecting to Stockholm in Newark. He booked his ticket on SAS, a Scandinavian airline. SAS doesn't have a direct flight between Raleigh and Stockholm, so it included a so-called codeshare flight on United from Raleigh to Newark, where the SAS flight was scheduled to depart.

However, Berg said, her son was put on the wrong plane. It was a flight to Düsseldorf, Germany, operated by the German airline Eurowings, a low-cost subsidiary of Lufthansa.

Both Eurowings and SAS operate those flights as codeshares with United.

Berg said the issue began when United forced her to register her son as an unaccompanied minor. He was not allowed to manage his own connection at Newark and was instead brought to a room for unaccompanied minors and led straight to the wrong plane, she said.

Read more: The Justice Department is looking deeper into Boeing while the company scrambles to get its troubled 737 Max plane up and running again

She said that when she arrived at the Raleigh-Durham airport to check her son in for his flight, she was told that because he was 14, she had to pay a $150 fee for the unaccompanied-minor service. United's website says that the service is required for 5- to 14-year-olds who are traveling alone and that it provides airline representatives to assist them.

However, United's website also says that underage passengers connecting to or from partner airlines can't use its unaccompanied-minor service.

A United representative told Business Insider that a 14-year-old flying alone typically wouldn't be allowed when there's an international connection involved. However, because the ticket was sold by SAS, which considers children 11 and under to be minors, the check-in agent decided to allow the teenager onto the connecting flight with the airport escort service.

The paperwork that the 14-year-old was given had the correct flight information on it, but there was a gate change between when it was printed and when he arrived at Newark for the connecting flight. A Eurowings plane, Flight EW1113 to Düsseldorf, was sitting at the gate at that point.

The United representative said the Düsseldorf flight was ready to leave, awaiting one more passenger, who had a similar name as the boy. They were preparing to close the doors, calling the passenger's name, when the person escorting the boy heard the announcements, assumed it was supposed to be him, and rushed him onto the incorrect plane.

Read more: Tesla's investigation confirms a Model S that caught fire on video in Shanghai had a faulty battery module

In a phone call with Business Insider, Brenda Berg said her son realized he had been escorted onto the wrong plane and notified a flight attendant at 4:50 p.m., while both planes were still on the ground. The Eurowings plane returned to the gate and let her son off, but the correct flight had already departed.

Berg disputed United's version of what happened, saying the passenger that Eurowings had been calling for as the doors were closing was already on the plane, seated next to her son.

Eventually, she tweeted that SAS helped her son book a later flight going to Copenhagen, Denmark, with a connection on to Stockholm.

"This is not what we wanted — an international transfer," Berg tweeted. "I have been up all night thinking about the fact that he was one call button away from landing in Germany without being on the manifest!"

Her son eventually landed in Denmark and made the connection to Stockholm.

United issued this statement to Business Insider:

"The safety and well-being of all of our customers is our top priority, and we have been in frequent contact with the young man's family to confirm his safety and to apologize for this issue. Once Eurowings recognized that he had boarded the wrong aircraft in Newark, the plane returned to the gate — before taking off. Our staff then assisted the young customer to ensure that he boarded the correct rebooked flight later that evening. We have confirmed that this young customer safely reached his destination."

Eurowings did not immediately respond to a request for comment about how Berg's son was allowed to board the flight without the correct boarding pass.

United told Business Insider it had refunded the unaccompanied-minor fee. Berg said she has not heard from the airline since Sunday night.

Berg's son ultimately made it to Stockholm, nearly 10 hours late. However, Berg said she worries about what would have happened under different circumstances.

"If he had been 10, this would have been so much worse," she said. "There's a lot that needs to be fixed, but ultimately, if you're going to have an unaccompanied-minor program, it absolutely has to work correctly."