Firefighters were pelted with bricks and bottles as they tackled a skip and wheelie bin fire in Barnsley.
None of the eight crew were injured but two fire engine doors were badly dented in the attack on Kenworthy Road on Wednesday night.
Paul Salter, of South Yorkshire Fire Service, said the damage, caused by an item similar to a house brick, could seriously have injured the crew.
He said: "We will be doing everything in our power to identify the culprits."
Mr Salter added: "It is frightening to think that had it hit the appliance a few inches higher it would have gone straight through the open window and seriously injured one of our firefighters.
"This was a disgraceful attack on a group responding to an emergency incident."
Earlier this month South Yorkshire Fire Service said attacks on its members had fallen since engines were equipped with CCTV.
Figures showed there were 37 attacks on firefighters between April 2009 and March 2010, down from 68 the previous year.
Mr Salter added: "We have had a great success in reducing attacks but even one incident is too many."