U.S. stock funds gained inflows of $21.5 billion for the first quarter of the year, marking the sector's best quarter since 2004, according to a report by Morningstar.

It is also the first positive quarter for the asset class since the beginning of 2011, according to the financial research firm.

International-stock funds took in $12.1 billion in March and $47.0 billion for the quarter.

In total, investor’s added $184.3 billion to long-term, open-end mutual funds, while redeeming $92.8 billion from money market funds, according to the report.

Alternative and commodities funds had strong March inflows, collecting $2.0 billion and $1.4 billion, respectively. For the quarter, alternatives saw inflows of $9.2 billion, the best three months on record for the asset class.

For the 19th consecutive month, taxable-bond funds topped all asset classes with inflows of $19.3 billion in March, bringing their inflows for the quarter to $69.1 billion.

Of the $184.3 billion in total industry inflows, Vanguard gained the most at $34.0 billion and PIMCO followed with $23.0 billion, according to the report.