Apple chief Tim Cook slammed what he called a wave of "dangerous" laws in several US states that he said promote discrimination and erode equality, in an editorial published Sunday.
Cook -- one of the most prominent chief executives to publicly acknowledge his homosexuality -- wrote in the Washington Post that so-called "religious freedom" laws passed in several states threaten to undo progress toward greater equality.
"There's something very dangerous happening in states across the country," Cook wrote in the editorial.
"These bills rationalize injustice by pretending to defend something many of us hold dear. They go against the very principles our nation was founded on."
Cook's comments follow the adoption of a controversial law in the state of Indiana last week that critics say would allow businesses to deny service to homosexuals on religious grounds.
The law, which takes effect July 1, makes no mention of gays or lesbians. But activists say it makes it legal for businesses whose owners reject homosexuality on religious grounds to turn away LGBT customers.
Eighteen other states have adopted similar laws, including Kentucky, Tennessee and Texas, all of which ban same-sex marriage.
Cook said such laws erode fundamental rights and make no sense for business owners.
"America's business community recognized a long time ago that discrimination, in all its forms, is bad for business," he wrote.
"On behalf of Apple, I'm standing up to oppose this new wave of legislation -- wherever it emerges."
Cook, who was baptized as a child, said he has "great reverence for religious freedom," but said faith should not be used as a tool to discriminate.
"The days of segregation and discrimination marked by 'Whites Only' signs on shop doors, water fountains and restrooms must remain deep in our past," he added.
"We must never return to any semblance of that time. America must be a land of opportunity for everyone."
Cook repeated his earlier statement that "Apple is open for everyone" and said he hopes more people will join his campaign against intolerance.
The Indiana bill sparked fury among activists, athletes and Hollywood stars who came out strongly against it.
Same-sex marriage is now recognized in 37 states after the US Supreme Court in 2013 ruled that federal law could not discriminate against wedded lesbian, gay, bisexual, and transgender (LGBT) couples.
The legislation adopted in Indiana, however, is styled on the Religious Freedom Restoration Act, a 1993 federal law that makes it illegal to "substantially burden" an individual's freedom of religion.