President Ian Khama told the Reuters news agency that he had personally ordered his arrest.
"We don't want hate speech in this country. Let him do it in his own country," he said.
Last week, South Africa barred Mr Anderson from visiting because of his critical remarks about homosexuality.
Homosexual acts are illegal in Botswana, as in many African countries.
After his visa for South Africa was rejected, Mr Anderson had posted on his Facebook page: "Thank God we still have a wide open door in Botswana."
Mr Anderson was taking part in a morning show hosted by GabzFM station together with a local pastor and an LGBT activist.
The show's presenter Reginald Richardson told the BBC that Mr Anderson expressed disdain for homosexuals during the show saying that they should be killed.
Botswana's private Mmegi newspaper reported that security agents apprehended the pastor after the radio show.
"I am not being arrested. I am leaving Botswana voluntarily," Mr Anderson told witnesses at the radio station, Reuters reports.
Onkokame Mosweu, a commentator on gay and lesbian affairs, commended the government's action but said that the pastor should not have been allowed into the country.
Mr Khama said that the pastor had been put on a visa watch list after he was banned from travelling to South Africa, but the order had not been communicated to all officials manning the country's borders.
The preacher had arrived in Botswana late last week and had given a sermon at a local church that he helped set up, Mr Richardson said.
Mr Anderson runs the Faithful Word Baptist Church, which says that homosexuality is an abomination punishable by the death penalty.
His church is based in the US state of Arizona and describes itself as an "old-fashioned, independent, fundamental, King James Bible only, soul-winning Baptist church".

The former Superior General of Missionaries of Charity was suffering from various ailments.
She took over the running of the charity after Mother Teresa died in 1997 and ran it for 12 years before Sister Mary Prema took over in 2009.
The Missionaries of Charity cares for the homeless and dying in Kolkata.
Archbishop of Kolkata Thomas D'Souza told the AFP news agency that Sister Nirmala "passed away peacefully, surrounded by sisters praying for her".
"She had been suffering from a heart disease for quite some time, but she never lost her smile and was always cheerful."
He said Sister Nirmala "carried forward Mother Teresa's legacy of compassion, gentleness, service to the poorest of the poor and holiness of life".
"Even after she ceased to be head of Missionaries of Charity, she served the people with the same zeal as she did before."
Reports say Sister Nirmala's body will be kept at the Missionaries of Charity headquarters in Kolkata and her funeral will be held on Wednesday afternoon.
Prime Minister Narendra Modi led the tributes to the deceased nun.
West Bengal Chief Minister Mamata Banerjee said she was "saddened" by Sister Nirmala's death.
The Missionaries of Charity has about 4,500 nuns and hundreds of homes around the world.
Botswana is to deport controversial US pastor Steven Anderson after he said on a local radio that homosexuals should be "stoned to death".
[NEXT_CONCEPT]
Sister Nirmala, the nun who succeeded Mother Teresa as the head of a charity in the Indian city of Kolkata (Calcutta), has died, aged 81.