Of this over $13 billion went into new projects, up 11.6 percent, and $7.09 billion into existing ones, a 24.2 percent increase.
But there was a 40.6 percent decline to $3.63 billion in spending on mergers and acquisitions.
Some $12.74 billion, or 53.7 percent, went into the processing and manufacturing sector, $5.54 billion into power generation and distribution and the remainder mainly into real estate, wholesale and retail.
Singapore was the largest source of foreign investment with $6.77 billion, followed by South Korea with $4.15 billion and Japan with $3.4 billion.
The southern province of Long An received the biggest share of investment ($3.68 billion), followed by HCMC ($2.73 billion) and the northern city of Hai Phong ($2.72 billion).
Last year, FDI had fallen by 25 percent to $28.5 billion as the Covid-19 pandemic prevented air travel and dampened investor sentiment.