Wyoming quarterback Josh Allen celebrates a touchdown. (Tom R. Smedes/Associated Press)

Quarterback prospect Josh Allen is on an apology tour Thursday morning after old tweets with racially indecent remarks surfaced online mere hours before the NFL draft.

Allen, who was expected to be a top choice in the draft, called the tweets “young and dumb” in an apology to ESPN’s Stephen A. Smith. Yahoo Sports first identified the messages, which refer to rap lyrics and were posted between June 2012 and June 2013. They have since been deleted from Allen’s account.

He also responded to a question that looks like was asked of him on AskFM in 2013, saying “If it ain’t white, it ain’t right!” an apparent reference to a line from the popular television sitcom “Modern Family.”

“He was tremendously contrite. He was apologetic,” Smith said on his “First Take” talk show Thursday morning, recounting a late-night phone conversation with Allen. “He recognized that it was irresponsible for him to do the things that he did.”

“If I could go back in time, I would never have done this in a heartbeat,” Allen told ESPN’s Chris Mortensen on Thursday. “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.”

ESPN’s Adam Schefter said two sources floated the theory Thursday morning that another team may have leaked those tweets to tarnish Allen’s stock and make him available later in the first round.

More on the NFL draft from The Post:

A guide to Josh Rosen, the best quote in the NFL draft

How to watch and follow the NFL draft

Parrots, Chewbacca, curling stars and Casa Bonita: How Day 3 of the NFL draft will get a little nutty

Eagles owner’s anti-Trump comments surface as team discusses White House visit

For NFL hopefuls, the exhaustive draft process can ‘seem like horse trading’

It’s a quarterback-heavy NFL draft, but the three best players aren’t QBs