May 14 (Reuters) - A U.S. appeals court on Tuesday upheld a rule from President Joe Biden's administration that set the amount of biofuels that oil refiners were required to blend into the nation's fuel mix from 2020 through 2022, rejecting a challenge by oil refiners to the mandates.

The U.S. Court of Appeals for the District of Columbia Circuit found that the U.S. Environmental Protection Agency, which administers the obligations under the Renewable Fuel Standard (RFS), lawfully exercised its discretion in setting the requirements for the three years at issue.

Under the RFS, oil refiners must blend billions of gallons of biofuels into the U.S. fuel pool or buy credits from those that do. The credits, known as RINs, are used by oil refiners and importers to show compliance with mandates.

In the past, small refiners could receive an exemption from the requirements if they proved financial harm from the mandates.

In 2022, the EPA set biofuel blending mandates for that year at 20.63 billion gallons, as well as retroactive volume mandates for 2021 at 18.84 billion gallons and for 2020 at 17.13 billion gallons. The agency denied oil refiners waivers to be exempt from the requirements but said it would allow extra time for small refiners to meet their 2020 blending obligations.

Oil refiners challenged the rule, arguing that the standards were too high. Meanwhile, producers of so-called cellulosic biofuels, derived from wood waste and other feedstocks, also challenged the rule, saying the standards for cellulosic biofuels were too low.

"We hold that EPA complied with the law," the court said in a ruling filed on Tuesday.

Biofuel groups cheered the decision.

"Thanks to the D.C. Circuit opinion, EPA can ensure the integrity of its annual (Renewable Volume Obligation) and address shifts in market conditions and how refiners meet their blending obligations," Growth Energy CEO Emily Skor said in a statement.

(Reporting by Stephanie Kelly in New York; Editing by Will Dunham)