A college professor was arrested at Miami International Airport over the weekend after launching into a loud foreign policy lecture during a flight from Nicaragua. Her rant was captured on video and later posted online.

(Photo courtesy of the Miami-Dade Police Department) (Miami-Dade Police Department)

“The United States has declared war on Venezuela!” a woman aboard a plane says repeatedly in the video.

The Miami New Times identified the woman as 52-year-old Karen Halnon, an associate professor of sociology at Pennsylvania State University-Abington.

[Dulles-Denver flight: ‘Scariest moment’ as passenger subdued after cockpit dash]

“Venezuela has been declared a national security threat,” Halnon continues.

You’re a national security threat,” a passenger responds.

Halnon was charged with disorderly conduct, according to an arrest affidavit.

“The only thing I can say is I have deep regret that I used bad judgment, because two students were with me,” Halnon said in a phone interview with The Post on Tuesday evening, adding that she was “sincerely apologetic and deeply regretful” that she might have caused any harm to the students or the university.

The New Times reported that she was released after posting $500 bond.

“In a democracy one must speak up and against injustice,” Halnon said in an e-mail to The Post on Tuesday after saying in another email that she was mistreated during her arrest. “To be tortured is not democracy!”

A Miami-Dade Corrections spokesman said in an e-mail that there was “no indication that we experienced any issues” with Halnon, and no complaint about possible mistreatment had been filed by Tuesday afternoon.

“My political opinion remains to the same,” Halnon, who grew emotional when describing her experience, told The Post. “If I had to do it differently it would be without the students.”

Kelly Martin, a student at Old Dominion, filmed Halnon on the flight. She said she first noticed that the professor appeared to be talking to herself in Spanish after boarding the plane. Then Halnon eventually took off her seatbelt, stood up, and started shouting, Martin said.

[White House steps up sanctions against Venezuelans]

The New Times reported that the incident occurred on a flight from Nicaragua to Miami. Halnon also lit a cigarette on the plane, the New Times reported.

“Yes, that was me, and I was actually smoking a cigarette briefly,” Halnon told Miami’s CBS affiliate. “I took a few puffs out of it. … Every other revolutionary smokes.”

A Penn State-Abington spokesman said in an e-mail that the university was aware of the situation and looking into it.

“I would like to say that no matter what has happened to me and how difficult it has been personally, it’s nothing in comparison to the suffering of others,” Halnon told the Post. “All of that is entirely worth it if one Venezuelan life is saved through speaking out.”

Halnon told “Inside Edition” that she was sorry.

“I apologize to the passengers if I caused any fear,” she said, according to a Tuesday news release from the show. “I do apologize for any harm that I have done to Penn State.”

According to “Inside Edition,” Halnon said she was not intoxicated. “Anyone who is speaking out for social justice, it is the usual situation that most people will think they’re crazy,” she said, according to the show’s news release.

Martin said that as police were taking the professor off the plane, she shouted at passengers about how they could help post her bail.

“You realize that all of us just missed our connecting flights because of you,” Martin said. “None of us are going to bail you out of jail.”

The release noted that Halnon said she lit a cigarette on the plane “to show solidarity with her idol, Cuban dictator, Fidel Castro.” Halnon’s e-mail to The Post on Wednesday included this, in its signature:

“I am just beginning…my voice will not be stifled – it will arise from my breast even when I feel most alone, and my heart will give it all the fire that callous cowards deny it.” (Fidel Castro, History Will Absolve Me)

[This post has been updated.]

MORE READING: British Airways flight grounded after ‘smelly poo in the toilet’ overwhelms passengers

Harvard Business School professor apologizes for e-mail rant over a $4 overcharge

Transportation secretary weighs in on the airline legroom fights: ‘Travelers aren’t sardines.’

Son of Alabama Chief Justice Roy Moore arrested for drug possession, blames the media

‘Basically, they just fell out of the sky’: 2,000 snow geese found dead in Idaho