A Customs officer made racist remarks to an immigration officer at Birmingham International Airport, a court heard.
Stewart Gardner (56), of Peterdale Drive, Penn, had denied a charge of racially aggravated harassment towards Masud Afzal.
But on the day he was due to stand trial at Warwick Crown Court he pleaded guilty to an alternative offence of using threatening or offensive words and behaviour.
Gardner, who was described by his barrister as a senior Customs officer with 37 years' experience, was given a conditional discharge for 12 months and ordered to pay £750 costs.
Kate Iliffe, prosecuting, said that in September last year Mr Afzal was working on a passport control desk at Birmingham International Airport when Gardner returned on a flight from Malaga.
Gardner, who had had too much to drink on the plane, tried to walk past Mr Afzal's control point without having his passport examined.
Mr Afzal tried to stop him and put his arm out to indicate to him to stop, but Gardner just waved his passport.
And when Mr Afzal pointed out that he needed to look at it, Gardner responded by telling him: "I was born in this country, and you f****** was not."
He made further offensive comments when Mr Afzal took his passport, and told him: "Just f****** check it."
Mr Afzal, who said he was shocked and offended by the abuse, called for assistance and Gardner was taken away.
When he was asked why he had not produced his passport when asked to do so, Gardner said it was "because he's a f****** ethnic".
Judge Marten Coates commented: "It is quite clear these remarks were racist in context."
Simon Worlock, defending, accepted: "He behaved offensively and he should have known better. He would like to apologise in open court to the injured party. He knows his behaviour was unacceptable."
Gardner told Mr Afzal: "I would like to unreservedly apologise for my behaviour on the 29th of September."
Mr Worlock said the incident had happened after Gardner, who has been a Customs officer for 37 years without putting a step out of line, had walked into the airport and found an unexpected queue.
"It should not have happened. He should have known better. He is appalled by his own behaviour."
Sentencing Gardner, Judge Coates told him: "I know you regret it and I hope very much the apology given to Mr Afzal will be accepted."