A Massachusetts state senator who opposes President Donald Trump’s immigration policies was mistakenly booked on Fox News, and she used the airtime to criticise Mr Trump’s “illegal and inhumane” treatment of migrant families crossing the US-Mexico border.

Barbara L’Italien, a Democrat, appeared Monday on “Fox & Friends First”, instead of the intended guest, Democratic congressional candidate Ann Kirkpatrick, who has openly supported US Immigration and Customs Enforcement (ICE). A spokesman for Ms L’Italien said in a statement that “due to a Fox News error”, Ms L’Italien was contacted and asked to share her views on ICE and decided to use the opportunity to “make a statement straight to Trump”.

“I’m actually here to speak directly to Donald Trump,” she said during the broadcast. “I feel that what’s happening at the border is wrong.”

The senator said she has four children and believes that “separating kids from their parents is illegal and inhumane”.

Desiree Dunne, executive producer for “Fox & Friends First”, said in a statement to The Washington Post that the spokesman on file for Ms Kirkpatrick had accepted the invitation for the candidate.

“This morning, we invited Congresswoman Ann Kirkpatrick to appear on ‘Fox & Friends First’ through her press contact on file, Joe Katz, who accepted the invitation on Kirkpatrick’s behalf,” Ms Dunne said. “Katz followed with an email confirming the segment, which also included background information and a campaign logo for Ann Kirkpatrick. During the actual segment, Barbara L’Italien, appeared on camera instead of Ms Kirkpatrick.

“Despite speaking to producers prior to the interview, L’Italien did not identify herself as anything other than Kirkpatrick until she was live on air, at which point we ended the interview.”

When asked whether he indeed had sent Ms Kirkpatrick’s background information and campaign logo to the network, Mr Katz said in an email: “I showed the exact same commitment to the truth and accuracy that Fox News always has.”

The segment began with a video clip showing Ms Kirkpatrick, a Democratic candidate in Arizona’s 2nd Congressional District, getting booed as she raise her hand in support of ICE during a recent debate.

‘Families belong together’ protests over Trump immigration policy Show all 8 1 /8 ‘Families belong together’ protests over Trump immigration policy ‘Families belong together’ protests over Trump immigration policy Mishawaka, Indiana AP ‘Families belong together’ protests over Trump immigration policy Washington DC AFP/Getty Images ‘Families belong together’ protests over Trump immigration policy New York Mayor Bill De Blasio speaks in Tornillo, Texas alongside the many other US mayors who have called for detained immigrant children to be reunited with their families AP ‘Families belong together’ protests over Trump immigration policy Albuquerque Mayor Tim Kelle leaves a teddy bear as a gift for detained immigrant children in Tornillo, Texas AP ‘Families belong together’ protests over Trump immigration policy Seattle Mayor Jenny Durkan and Los Angeles Mayor Eric Garcetti leave sandals as gifts for detained immigrant children in Tornillo, Texas AP ‘Families belong together’ protests over Trump immigration policy San Diego, California EPA ‘Families belong together’ protests over Trump immigration policy US embassy, Mexico City AFP/Getty Images ‘Families belong together’ protests over Trump immigration policy San Diego, California EPA

“Joining us now, that candidate – the only Democrat onstage to support ICE – Ann Kirkpatrick. Thank you for joining us. We appreciate it. Tell us why you do support ICE,” Fox host Jillian Mele said, according to a clip on L’Italien’s YouTube channel.

“I’m actually Barbara L’Italien,” said Ms L’Italien, who also is running for Congress.

“I keep thinking about what we’re putting parents through – imagining how terrifying that must be for those families, imagining how it would feel no knowing whether I’d ever seen my kids again,” the state senator added. “We have to stop abducting children and ripping them from their parents’ arms, stop putting kids in cages and stop making 3-year-olds defend themselves in court.”

Within seconds, Fox hosts Rob Schmitt and Mele interrupted, telling Ms L’Italien that migrant children are no longer separated from their parents. A federal judge in San Diego has ordered the US government to reunite about 2,500 migrant children with their families by Thursday after the children were seized as part of the Trump administration’s “zero tolerance” crackdown on illegal immigration.

“Again, my name is Barbara L’Italien,” Ms L’Italien pressed on. “I refuse to believe that our only options are open borders or -” she continued before the broadcast abruptly ended.

“Who is this?” Mr Schmitt said, as someone in the studio began to clap. “That didn’t go as planned.”

After the segment, <Ms L’Italien said on Twitter that her time on the air had been cut short, and she continued with her prepared statement.

“I refuse to believe that our only options are open borders or traumatising children, and shame on you for pretending that they are. Shame on you for putting this vile, racist policy in place,” she said, addressing Mr Trump.

“Our immigration system should be just, fair, compassionate and reflect our values as a nation of immigrants,” Ms L’Italien added. “What we have now, what you are doing, is none of those things.