A West Point cadet who wore a Che Guevara T-shirt to his graduation and posted a message online saying “communism will win” has been discharged from the US army.

The images Spenser Rapone posted on Twitter from his May 2016 West Point graduation were meant to shock: in one, he opens his dress uniform to expose a T-shirt with a red image of the socialist icon Che Guevara. In another, he raises his fist and flips over his cap to reveal the hand-scrawled message: “Communism will win.”

The images, posted later in 2017, drew vitriol and even death threats. Now the second lieutenant who became known as the “commie cadet” is out of the army with an other-than-honorable discharge.

Sign up to receive the top US stories every morning

Top brass at Fort Drum’s 10th Mountain Division accepted Rapone’s resignation on Monday after an earlier reprimand for “conduct unbecoming of an officer”. Rapone said an investigation found he went online to advocate for a socialist revolution and disparage high-ranking officers and US officials. The army said in a statement only that it conducted a full investigation and “appropriate action was taken”.

An unrepentant Rapone summed up the fallout in a tweet on Monday that showed him extending a middle finger at a sign at the entrance to Fort Drum, accompanied by the words: “One final salute.”

Facebook Twitter Pinterest Spenser Rapone after graduating. Photograph: AP

“I consider myself a revolutionary socialist,” the 26-year-old said. “I would encourage all soldiers who have a conscience to lay down their arms and join me and so many others who are willing to stop serving the agents of imperialism and join us in a revolutionary movement.”

Rapone said his journey to communism grew out of his experiences as an army ranger in Afghanistan before he was accepted into the US Military Academy. And those views only hardened during his studies of history as one of the academy’s “Long Gray Line”.

He explained that he took the offending selfies at his May 2016 West Point graduation ceremony and kept them to himself until last September, when he tweeted them in solidarity with the NFL quarterback Colin Kaepernick, who was taking heat for kneeling for the national anthem to raise awareness of racism.

Many other military personnel also tweeted in favor of Kaepernick, although most were supporting free speech, not communism.

West Point released a statement after Rapone posted the photos, saying his actions “in no way reflect the values of the US Military Academy or the US Army”. And the US senator Marco Rubio, a Florida Republican, called on the secretary of the army to remove Rapone from the officer ranks.

“While in uniform, Spenser Rapone advocated for communism and political violence and expressed support and sympathy for enemies of the United States,” Rubio said on Monday, adding: “I’m glad to see that they have given him an ‘other-than-honorable’ discharge.”

One of six children growing up in New Castle, Pennsylvania, Rapone said he applied to West Point, which is tuition-free, because he couldn’t afford college. He was nominated out of high school by the then US representative Jason Altmire in 2010.

Missing US air force officer found in California after 35 years Read more

“He was an honors student, an athlete, a model citizen who volunteered in the community,” recalled Altmire, a Democrat. “During the interview, he expressed patriotism and looked just like a top-notch candidate. There were no red flags of any kind.”

Rapone was not accepted to West Point, so he enlisted. He was deployed to Afghanistan in 2011 and was assigned as an assistant machine gunner in Khost province.

“We were bullies in one of the poorest countries on Earth,” Rapone said. “We have one of the most technologically advanced militaries of all time and all we were doing is brutalizing and invading and terrorizing a population that had nothing to do with what the United States claimed was a threat.”

Towards the end of his deployment, he learned that West Point fulfils a certain quota of enlisted soldiers every year. Despite his growing disillusionment about the military, he applied and got in.

“I was still idealistic,” he said.” I figured maybe I could change things from inside.”

In addition to classic socialist theorists such as Karl Marx, Rapone says he found inspiration in the writings of Stan Goff, a retired special forces master sergeant who became a socialist anti-war activist.

While he was a cadet, Rapone’s online postings alarmed a West Point history professor, who wrote Rapone up, saying his online postings were “red flags that cannot be ignored”. Rapone was disciplined but still allowed to graduate.

Greg Rinckey, an attorney specializing in military law, said it was rare for an officer out of West Point to receive an other-than-honorable discharge. He added that it was also possible the military academy could seek repayment of the cost of Rapone’s education because he did not serve the full five-year service obligation required upon graduation.

“I knew there could be repercussions,” said Rapone, who is scheduled to speak at a socialism conference in Chicago next month. “Of course my military career is dead in the water. On the other hand, many people reached out and showed me support. There are a lot of veterans both active duty and not that feel like I do.”