South Bend Mayor Pete Buttigieg lashed out a Donald Trump for complaining that he didn’t get thanked for the late Senator John McCain’s funeral.

Speaking at a factory in Ohio, Trump complained that no one thanked him for McCain’s funeral after the longtime senator died last August.

“I gave him the kind of funeral that he wanted, which as president I had to approve,” Trump said, even though it was Congress that allowed McCain to lie in state.

“I don’t care about this, I didn’t get a thank you. That’s OK,” Trump added, even though he clearly wasn’t OK since he brought it up seven months later.

Related: John McCain just hit Donald Trump where it’ll hurt most. His ego.

Buttigieg, who is running for president, hit back at Trump, accusing him of avoiding military service by faking a disability, while McCain fought in the Vietnam War and was held as a prisoner of war for six years.

“When a president (who faked a disability in order to avoid serving) attacks a departed war hero, it’s for attention,” Buttigieg wrote.

When a president (who faked a disability in order to avoid serving) attacks a departed war hero, it’s for attention. We should honor the late Senator McCain, and also follow his example by focusing not on the behavior of the president but on the future of our country. — Pete Buttigieg (@PeteButtigieg) March 20, 2019

Trump was never in the military and received five deferments to avoid being sent to Vietnam. The first four were educational deferments from when he was a college student, and the fifth was medical.

The daughters of a podiatrist in New York claim that their father falsified a diagnosis of bone spurs in 1968 to get Trump out of military service because Trump’s father Fred was the podiatrist’s landlord. The daughters cite “family lore.”

McCain’s record on LGBTQ issues was mixed. He opposed marriage equality but also opposed the transgender military ban. In 2016, he blamed Barack Obama for the shooting at the Pulse nightclub in Orlando.