Gerry Adams, president of Irish republican political party Sinn Fein, tweeted Sunday night: "Watching Django Unchained -- A Ballymurphy N----r!"
"Django Unchained" is a 2012 Oscar-winning Quentin Tarantino movie in which Jamie Foxx plays a freed slave trying to rescue his wife from a Mississippi plantation.
Ballymurphy is the area of Belfast, Northern Ireland, in which Adams was born, and where British soldiers killed civilians in a series of shootings in 1971.
His tweet, which featured the uncensored version of the racial epithet, provoked a storm of criticism and was swiftly deleted.
He eventually released a statement apologizing "for any offense caused"
Monday amid mounting pressure over the remark.
Adams had earlier released a statement saying that if "anyone is genuinely offended by my use of the N-word they misunderstand or misrepresent the context in which it was used."
Adams: It was ironic
Adams' initial response to the controversy was a tweet saying that his use of the word was "ironic" and that "Nationalists in (Northern Ireland) were treated like African Americans."
He later released a statement
defending the tweet, saying the use of the word was "not intended to cause any offense whatsoever."
"Attempts to suggest that I am a racist are without credibility. I am opposed to racism and have been all my life," the statement read.
"The fact is that nationalists in the north, including those from Ballymurphy, were treated in much the same way as African Americans until we stood up for ourselves."
Explanation 'adds insult to injury'
That explanation left many underwhelmed.
"For anyone to use such a term is unacceptable," said Stewart Dickson, chief whip of Northern Ireland's Alliance Party.
"The attempted explanation from him is not only historically inaccurate but deeply offensive to many."
Steven Agnew, leader of the Green Party in Northern Ireland, tweeted: "The comment was a disgrace but the explanation adds insult to injury. Just say 'sorry'."
Clare McConnell from Belfast tweeted: "No white man in a position of privilege gets to decide when he can use that word."
"Don't compare black oppression to Ireland. Just don't."
The growing outcry prompted a rethink by Adams on Monday, and he released a statement expressing an apology.
However, he said he stood by his main point regarding "the parallels between people in struggle."
"Like African-Americans, Irish nationalists were denied basic rights," he said.
"The civil rights movement here, of which I was a founding member, was inspired and based its approach on the civil rights campaign in the USA. I have long been inspired by Harriet Tubman; Frederick Douglas; Rosa Parks; Martin Luther King and Malcolm X who stood up for themselves and for justice."
Colorful Twitter presence
Since joining Twitter in 2011, the 67-year-old has gained 111,000 followers -- the most of any Irish lawmaker -- for his idiosyncratic, often bizarre posts that present a very different side to the flinty politician.
By contrast, his Twitter feed is a stream of nursery rhymes, pictures of teddy bears and rubber ducks, references to trampolines and the occasional selfie with a goat.
He has even released a book collating his favorites called "My Little Book of Tweets."
Adams can't resist a "dad joke" -- as evidenced in this snap of his breakfast he saw fit to share. "The yokes (sic) on me," he tweeted.
And if they really take his fancy -- such as in these pictures of his dog -- then "doggone it!" he's not afraid to make them twice.
He has related his enjoyment of jumping on his trampoline -- one "busy beautiful morning" began with him "trampolining from dawn," according to one tweet.
And he has a thing about sheep: "We r 3 little lambs who have lost our way Baa Baa Baa. Little black sheep who have gone astray Baa Baa Baa (sic)," he tweeted in March.
Soft toys are also make a regular fixture in his feed.
The "Django Unchained" incident wasn't the first time Adams' Hollywood viewing habits have become a talking point.
In January, he shared this musing on another prominent Irishman.
"I never knew Pierce Brosnan was so good looking," he volunteered.