Retired Navy SEAL Eddie Gallagher met President Trump at Mar-a-Lago over the weekend to thank him for taking up his controversial case.

Photos show Gallagher, 40, and his wife Andrea chatting with Trump and First Lady Melania Trump at the president’s swanky Palm Beach resort.

“Finally got to thank the President and his amazing wife by giving them a little gift from Eddie’s deployment to Mosul,” Gallagher and his wife Andrea captioned the images, posted Saturday on a joint Instagram account.

In one of the photos, the president can be seen holding what looks like a wrapped gift, though it wasn’t clear what the present was.

The couple also posed for a photo with the president’s son, Donald Trump Jr., at the conservative group Turning Point USA’s Student Action Summit on Saturday.

Gallagher was acquitted of murdering a 17-year-old Islamic State terrorist while deployed to Iraq in 2017, but he was convicted of posing for a photo with the captive’s corpse.

He was demoted to petty officer first class and had his pay cut — until Trump stepped in to reverse his punishment and restore his rank.

A disciplinary hearing that could have resulted in Gallagher being stripped of his Trident pin, which designates him as a member of the elite commando unit, was also scrapped.

Trump announced on Twitter that he wouldn’t allow the Navy to take Gallagher’s pin.

The controversy led to the firing of Navy Secretary Richard Spencer.