Megan Rapinoe reflected on the swings of fortune that often make football so cruel as she bowed out her final World Cup after the United States lost to Sweden on penalties on Sunday night.

The 38-year-old’s prowess on set-pieces has helped her win two World Cups with her country. But she was one of three USA players to miss a penalty in Sunday’s shootout, which Sweden won 5-4.

“I’m really happy for us that we went out like that, playing the way we did [against Sweden], having a ton of joy on the ball,” she told Fox Sports after the game. “This is like a sick joke for me personally, this is a dark comedy that I missed a penalty. This is the balance to the beautiful side of the game.”

The defeat to Sweden meant the US failed to reach at least the semi-finals of the World Cup for the first time in their history. Rapinoe told Fox Sports defeat brought mixed emotions.

“I still feel really grateful and joyful and I know it’s the end and that’s sad,” she said. “But to know that this is the only time I’ve been in [a penalty shootout] this early [at a World Cup] says a lot about the success I’ve been able to have, just how much I’ve loved being able to play for this team and this country. Yeah, this has been an honour.”

The defeat came in dramatic circumstances after the match had ended 0-0 after extra-time. USA goalkeeper Alyssa Naeher thought she had saved Lina Hurtig’s decisive penalty but VAR showed the ball had narrowly gone over the goalline.

“We just lost the World Cup by a millimetre,” said Naeher, who also scored a penalty in the shootout. “That’s tough … We had great chances, hats off to the Swedish goalkeeper for a number of great saves on her end to keep it at 0-0. I’m proud of the battle, proud of the group. We showed that American mentality again that’s been standard for this team. To come up short hurts, it’s going to hurt for a long time.”

For other US players, the despair in defeat was clear.

“I’m devastated, it feels like a bad dream,” said Alex Morgan who, like Rapinoe and Naeher, was hoping to win her third World Cup with the US. “I feel like we dominated tonight but it doesn’t matter … we are going home, it’s the highs and lows of the sport of soccer.”

USA captain Lindsey Horan said she has faith the team will come back stronger at the next World Cup.

“I think you saw it on the field today,” she said. “Being able to come out of the group stage where we didn’t perform our best and change it to this type of performance. This is what this team is going to be made of. So many young players coming through and absolutely killing it. How incredible Naomi [Girma] was this tournament [and] so many others.”

USA coach Vlatko Andonovski may not be around to see those players develop. His job is under threat after a disappointing campaign. But he said he is optimistic about the future.

“Five players who started this game are in the [World Cup] for the first time … these are players who will be here for years to come,” he said. “This tournament is a great experience for them. I think [the team] will dominate with players who unfortunately couldn’t make it like Mal [Swanson] and Catarina Macario.”