In a lengthy Twitter thread, Amash wrote: "After much reflection, I’ve concluded that circumstances don’t lend themselves to my success as a candidate for president this year, and therefore I will not be a candidate."
The president himself seemed to think Amash would be a boon to his campaign given he seemed happy to encourage the congressman to jump into the race in a tweet in late April.
Trump, apparently sarcastically, wrote, "No, I think Amash would make a wonderful candidate, especially since he is way behind in his district and has no chance of maintaining his Congressional seat. He almost always votes for the Do Nothing Dems anyway."
"This was a difficult decision for me, especially having seen grassroots supporters put so much effort into this campaign," Amash wrote. "It’s been humbling and awesome."
"I continue to believe that a candidate from outside the old parties, offering a vision of government grounded in liberty and equality, can break through in the right environment," he added. "But this environment presents extraordinary challenges."
Amash has been a frequent critic of Trump.
He voted with Democrats for Article I during the Trump impeachment hearing, for instance, and criticized Trump for authorizing the strike against Iran Gen. Qassem Soleimani in Iraq in January, saying, "Our system demands consent for war from the people, acting through their representatives and senators in Congress."
ABC News' Ben Siegel contributed to this report.