Donald Trump, who received five deferments from the Vietnam war draft, has angered military veterans by wearing a flight jacket and an admiral's cap during a visit aboard an aircraft carrier.

The president sported the olive military jacket and hat during a tour of the new Gerald R. Ford carrier in Newport News, Virginia, as he pledged to boost defence spending.

The jacket and hat, which was personalised with the words "POTUS 45" on the back, were a gift from the crew.

"They said, 'Here Mr. President, take this home.' I said, 'Let me wear it,'" Mr Trump said during his address to the crew, drawing laughter. "And then they gave me the beautiful hat, and I said, 'You know? Maybe I'll do that.' "

He continued, "We have a great 'Make America Great Again' hat, but I said, 'This is a special day, we're wearing this.' "

His decision to don the clothing provoked anger on social media, especially among veterans.

"As a Veteran watching a 5 time draft dodging COWARD saluting a Marine guard is the epitome of HYPOCRISY Impeach this cowardly b------ NOW!!!," tweeted Chuck Williams.

Author and broadcaster Joy Reid tweeted: “Trump – who got five deferments from Vietnam – is currently cosplaying as a military man, complete with hat and jacket.”