SYDNEY, Australia — Australia’s most prominent female Muslim activist, an outspoken critic of her country’s immigration policies, was denied entry into the United States on Wednesday.

Yassmin Abdel-Magied, 27, an award-winning author and broadcaster, was scheduled to speak next week at the Pen World Voices Festival in New York. When she arrived in Minneapolis around 4 p.m., she said on Twitter, she was detained by border agents.

“I’m currently at the border, and they’ve said I’m being deported,” Ms. Abdel-Magied wrote on Twitter. “This should be fun. What are my rights?”

The agents, she said, told her they had canceled her visa and required her to return to London, where she currently lives.

According to the American authorities, Ms. Abdel-Magied was denied entry because they determined that she was being paid to speak at the conference, a violation of her visitor’s visa.

Ms. Abdel-Magied said that while waiting in a holding room before her return flight to Europe, she passed the time painting her nails and reading a book.

“My heart’s been on double time for the last three hours,” she said when reached via Twitter as she waited for her return flight. “The system isn’t set up for people like me.”

Ms. Abdel-Magied said she had visited the United States many times previously on the same visa without issue.

She has spoken in the United States previously, she said, at events for Chevron and the Inter-American Development Bank. She was last in the United States in February, she said, on the same visa to speak at a conference for Twitter.

Ms. Abdel-Magied said she was traveling with a B1/B2 visa. That document allows foreign nationals to visit the United States to attend a “scientific, educational, professional, or business convention or conference,” according to the State Department. But it prohibits paid performances, or “any professional performance before a paying audience.”

In a statement, the United States Customs and Border Protection agency said Ms. Abdel-Magied did not have an appropriate visa to enter the country for paid work.

“During the inspection, C.B.P. officers determined this individual did not possess the appropriate visa to receive monetary compensation for the speaking engagements she had planned during her visit to the United States,” the agency said.

“The traveler is eligible to reapply for a visa for future visits,” the statement read.

Ms. Abdel-Magied is the daughter of Sudanese immigrants to Australia. She has been a critic of Australia’s refugee and immigration policy and writes regularly about her experiences as both a Muslim and a feminist.

In 2017, Ms. Abdel-Magied moved to London, after a backlash over a Facebook post she wrote critiquing Australia’s refugee detention policy on Anzac Day, a national day of remembrance for the country’s war dead. She has called herself “Australia’s most publicly hated Muslim.”

Ms. Abdel-Magied had planned to speak on two panels at the Pen World Voices Festival: one on her experiences as a Muslim woman in a Western country and another on online harassment.

In a statement, the festival’s organizers said: “We call on Customs and Border Protection to admit her to the U.S., so that she can take her rightful place in the urgent international conversation to take place at the festival.”