"Megan should never disrespect our Country, the White House, or our Flag, especially since so much has been done for her & the team," Trump tweeted Wednesday.
The president also tweeted that he will invite the U.S. team "win or lose."
Rapinoe's comments came during an interview for a magazine in January in which she was asked if she was excited by the prospect of going to the White House. In a video of an interview excerpt posted Tuesday, she can be seen using a profanity when she says she's not going.
"We're not gonna be invited," she added.
The U.S. team, the defending World Cup champion, plays host France in a quarterfinal match on Friday.
Trump's tweets came two days after an interview with The Hill in which he said it wasn't appropriate for Rapinoe to protest during the national anthem.
Rapinoe started kneeling during the anthem in 2016 to show solidarity with former San Francisco 49ers quarterback Colin Kaepernick, who did it before NFL games to protest social and racial injustice. But the United States Soccer Federation then adopted a policy that requires players to stand.
Now she stands, but she has been criticized for not singing and putting her hand over her heart like other players.
Rapinoe, who is gay, has frequently spoken out about politics and has criticized the Trump administration and its policies in the past.
Trump has used Twitter to criticize athletes who disagree with him, including Kaepernick and LeBron James.
Teammate Ali Krieger tweeted in support of Rapinoe. Media access to players is tightly controlled at the World Cup and the players were not available for comment.
Krieger said she would also skip a White House visit.
"I don't support this administration nor their fight against LGBTQ+ citizens, immigrants & our most vulnerable," Krieger posted.
Alex Morgan told Time Magazine last month that she would not visit the White House if the United States was invited.
"I don't stand for a lot of things the current office stands for," Morgan said, pointing particularly to the family separation policy at the southern border.
More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.