Olivia Rodrigo had a scary run-in with Border Patrol.

While touring, the singer was nearly arrested when she tried to reenter the United States. 

The Disney Channel star turned pop star opened up about the terrifying experience on Tuesday. 

OLIVIA RODRIGO FALLS THROUGH HOLE AT CONCERT, JOINING MADONNA, LUKE BRYAN IN WILD STAGE MISHAPS

Olivia Rodrigo smiling and holding a microphone on stage

Olivia Rodrigo performs onstage for the kickoff of the "Guts World Tour" at Acrisure Arena on Feb. 23, 2024, in Palm Springs, California. (Christopher Polk/Billboard via Getty Images)

"I got in trouble with the law for the first time in my life," the 21-year-old confessed on "The Tonight Show with Jimmy Fallon."

Rodrigo, who, since February has been making her rounds across the globe as part of her "Guts World Tour," says the incident happened when she was leaving Canada.

"We were going from Canada to like, Portland, or something. We were at border control. I give them my passport and they're like, ‘OK whatever.’" 

But then things changed.

"They knock on the door and they're like, ‘We need Olivia.’"

Olivia Rodrigo looks slightly to her right on the carpet, semi-mysteriously

Olivia Rodrigo initially assumed that someone was looking for an autograph. (Etienne Laurent/AFP via Getty Images)

LIKE WHAT YOU’RE READING? CLICK HERE FOR MORE ENTERTAINMENT NEWS

Having recently performed a slew of shows, Rodrigo thought someone at border control might have a daughter who'd like her autograph. 

"I come out, it's 3 a.m. and I'm delirious, and they take me to a room – and it's an interrogation room," she recounted, saying inside waiting for her was an armed officer. "And he's like, ‘Have you ever been arrested?’ I'm like, ‘No, I haven’t been arrested.' And he's like, ‘Are you sure?’"

Rodrigo said the officer's persistence made her start to question herself. "I'm like, ‘Oh my God, maybe I was arrested and I didn’t know it.'"

Olivia Rodrigo in a sparkly silver two piece set performs on stage with her mouth agape in shock

Olivia Rodrigo says she was questioned for 30 minutes by a border control officer, who warned her that lying to a federal officer could land her in jail. (Matthew J. Lee/The Boston Globe via Getty Images)

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

"He scared me," she continued. "He's like, ‘You know you could go to jail for lying to a federal officer like this. Like, this is really bad.'"

"I'm freaking out. I'm like, ‘I’m not gonna be let into America!'" the pop star recalled, saying she was "so scared" and "having a panic attack" at the time.

Olivia Rodriguez looks directly at the camera on the carpet at the Grammy Awards

"I'm freaking out. I'm like, ‘I’m not gonna be let into America!'" the pop star recalled. (Neilson Barnard/Getty Images for The Recording Academy)

"He scared me. He's like, ‘You know you could go to jail for lying to a federal office like this. Like, this is really bad.'"

— Olivia Rodrigo

"After 30 minutes of interrogation, he looks at me, and he goes, ‘What’s your name?'" 

"And I go ‘Olivia Rodrigo. R-O-D-R-I-G-O,’" she remembered. "He's like, ‘Oh, there’s a girl who looks just like you, that's your same age, that's been arrested multiple times, and her name is Olivia Rodriguez.'"

The "bad idea, right?" singer was not pleased.

"I was pissed," she admitted, questioning why border control hadn't paid more attention to her name. "Crisis averted," she concluded.

Fox News Digital reached out to Border Patrol as well as a representative for Rodrigo for comment.

Olivia Rodrigo in a white tank top and sparkly blue mini-shorts holding a megaphone on stage

Olivia Rodrigo, pictured here performing in Los Angeles, California, has been touring the world. (Christopher Polk/Billboard via Getty Images)

This hasn't been the only bump in the road for the singer during her tour. Earlier this month, while performing in Melbourne, Australia, the singer tripped and fell into a hole on stage.

She told Fallon, who played a video of the accident for the audience, that "it was really scary."

WATCH: OLIVIA RODRIGO FALLS THROUGH TRAPDOOR DURING PERFORMANCE

CLICK HERE TO GET THE FOX NEWS APP

"Watching the video was pretty terrifying. I mean, show must go on. That's showbiz baby."

Rodrigo, fortunately, had a positive outlook on the accident, saying she was actually "really happy it happened in hindsight." The singer said she was taken to the hospital after her concert for precautionary reasons – to check for a concussion – and the nurse who was assigned to her was a Filipino man with the same name as her grandfather, who recently passed away. Prior to her shows in Australia, Rodrigo had been performing in the Phillipines, where her family emigrated from years ago.

"I was like, ‘Wow, that was him looking out for me, making sure I didn’t get hurt.' And so I'm really happy it happened. I think it's a beautiful story."