The two-alarm fire was reported just after 9 p.m. in the 8300 block of Pine Avenue, fire officials said.
The fire was visible from miles away. No injuries were reported.
A smoke advisory was issued for parts of Riverside and San Bernardino counties. Residents are being warned about unhealthy air quality from smoke. Those who are sensitive to smoke are advised to keep doors and windows closed and use air conditioning with the air intake off.
Footage from AIR7 HD showed bales of hay burning out of control on the property that's about the size of a football field. As the raging blaze continued, workers were spotted using a forklift to save some of the hay.
While the barn appeared to be a complete loss, dozens of cows were kept safe overnight.
The fire was expected to continue to burn for several days, officials said.
"The tactic that we're using now is to allow this thing to burn up the fuel, and when it gets to a manageable point, we'll bring in some bulldozers and heavy equipment," said David Williams, Chino Valley Fire District battalion chief. "We're gonna have resources out here for the next three to five days to make sure that we keep this fire contained to its location, and that we'll take care of the livestock as well as any local residents in the area."
The Chino Valley Fire Department, CAL Fire and the Ontario Fire Department were among the fire agencies battling the blaze.
The cause of the fire remains under investigation.