WASHINGTON — President Trump’s charitable foundation increased its fund-raising and giving during his campaign last year, even as it became the subject of criticism that prompted a decision to dissolve it, according to paperwork submitted this month to the I.R.S.

The Donald J. Trump Foundation raised $2.9 million in 2016 — almost as much as it had raised in the preceding four years combined — according to its annual tax filing for 2016. It also showed that the foundation donated $3 million last year, more than it had given in the previous three years combined.

Most of the money came from a pair of $1 million donations from leading supporters of his presidential campaign — the Las Vegas gambling investor Phil Ruffin and Laura Perlmutter of Lake Worth, Fla., whose husband, Isaac Perlmutter, is the chairman of Marvel Entertainment. They donated in connection with an event that Mr. Trump staged to benefit military veterans, which set off scrutiny of his foundation for giving away only a fraction of the money it raised to charities, and for making payments in a manner that appeared to benefit Mr. Trump.

The foundation also attracted scrutiny from the New York attorney general, Eric T. Schneiderman, who found it had violated fund-raising rules and ordered it to cease soliciting contributions the month before the election. After Mr. Trump won, he directed his lawyers to begin the process of closing the foundation to avoid conflicts of interest.