Former US presidential candidate Ted Cruz is angry people are making fun of his belief the US is under threat from "space pirates".

"Since the ancient Greeks first put to sea, nations have recognised the necessity of naval forces and maintaining a superior capability to protect waterborne travel and commerce from bad actors," the Texas Senator said last week at a hearing in Washington.

"Pirates threaten the open seas, and the same is possible in space."

He was defending President Donald Trump's formation of a US Space Force, to defend the country's interests in the final frontier.

But rather than rallying the troops to fight the pirate peril, instead, he attracted mockery.

Space X founder Elon Musk - who actually knows how to get ships into space - tweeted a Jolly Roger emoji.