Motorsport boss Max Mosley has said he will impose immediate sanctions if there are any further incidents of racist abuse in Formula One.
Hamilton's clash with Alonso is thought to have sparked the abuse
McLaren's Lewis Hamilton was targeted by a section of spectators during pre-season testing in Barcelona.
"We will do whatever it takes to stamp this out," said Mosley, the president of governing body the FIA.
"If a very small number of people are involved, it ought to be possible to stop it immediately."
Mosley, in an interview with the Sunday Times, said the FIA could "pull the [Spanish] Grand Prix" if the racist abuse continued, but added that calls for the country to be stripped of one or both of its Grands Prix were premature.
"Not to give the Spanish authorities the opportunity to show they can deal with it and ensure there is no recurrence would have been over the top," he said.
"But it is necessary to make it clear it will not be tolerated, and we have done that."
Hamilton's father Anthony has claimed his son also suffered racist abuse by travelling Spanish fans at the Chinese GP in Shanghai last October.
The 23-year-old has been targetted following his public falling out with former Spanish team-mate Fernando Alonso last season.
"Anthony Hamilton told me that there were some people in China who were also appallingly abusive - not Chinese fans, but people who had travelled from Spain," said Mosley.
"If they went to Australia and did something like that, they could get arrested and we would know their names, and passport numbers, and they wouldn't get into another country."