Johnny Depp isn’t just a swashbuckler on screen.

The “Pirates of the Caribbean” star rescued a friend who was getting mugged in Los Angeles.

And when the bandit saw who had jumped into the fight, he said, “I ain’t stealing from Captain Jack,” The Sun in Britain reported.

The mugger, armed with a broken bottle, approached Depp’s pal, British singer, Stephen Jones, and demanded money.

After Depp intervened, the thief dropped the weapon and the actor gave him some money — and some advice: “Straighten up your life,” the paper said.