WASHINGTON — North Korea billed the Trump administration $2 million for the medical care of Otto F. Warmbier, an imprisoned American student who had fallen into a coma, before agreeing to release him in 2017.

A senior American diplomat negotiating for Mr. Warmbier’s freedom accepted the bill, and Mr. Warmbier was released. He died six days later in the United States, after his parents decided to end the life support that was sustaining his vegetative state.

The bill was passed from the State Department to the Treasury Department, but on Friday morning, President Trump said that no money had been paid.

“No money was paid to North Korea for Otto Warmbier, not two Million Dollars, not anything else,” Mr. Trump said in a Twitter post.