Top NFL draft pick Josh Allen apologised on Thursday following the emergence of offensive tweets containing a racist epithet.

Just hours before he was selected seventh overall by the Buffalo Bills in the 2018 draft on Thursday, Allen had scrambled to apologise for the posts, saying he was "young and dumb" when he wrote them in 2012-2013.

The 21-year-old quarterback was regarded as a potential top-five pick in this year's draft, which got under way on Thursday. The Bills didn't seem put off by the controversy as they traded up from the 12th spot to No. 7 to land Allen.

In the tweets, which have since been deleted, Allen repeatedly uses the N-word, and in one response to the question "Why are you so white?", replies: "If it ain't white, it ain't right!"

In an interview with ESPN's Chris Mortensen before the draft on Thursday, Allen said the tweets did not reflect his character.

"If I could go back in time, I would never have done this in a heartbeat," Allen said. "At the time, I obviously didn't know how harmful it was and now has become.

"I hope you know and others know I'm not the type of person I was at 14 and 15 that I tweeted so recklessly. ... I don't want that to be the impression of who I am, because that is not me. I apologize for what I did.

"It sucks. My family is hurting. We never envisioned a day or night like this."

Allen has been talked about as a possible number one pick in the draft, the annual event which sees the 32 teams in the National Football League take turns in recruiting the top players from college gridiron.

Allen's case echoes the social media controversy surrounding Laremy Tunsil in 2016. Video of Tunsil appearing to smoke marijuana through a gas mask emerged on draft day two years ago, bumping him down the order. He was later selected by the Miami Dolphins.