Image copyright Getty Images

The Brussels attacks have thrust foreign policy and counter-terrorism to centre stage in the presidential campaign, and provided further insights into the different instincts and worldviews of the candidates.

The reactions in the immediate wake of the terrorism attacks in Brussels have shown the differences in Republicans and Democrats in tone and substance. They have also laid bare the divide between the isolationist tendencies of the Republican insurgent candidates and decades of GOP orthodoxy on international affairs.

Republicans appealed to fear and retrenchment, with Texas Senator Ted Cruz saying "we need to empower law enforcement to patrol and secure Muslim neighbourhoods before they become radicalised" and called for sealing the border against "terrorist infiltration".

Donald Trump repeated his call to ban Muslims from entering the country and "close up our borders until we figure what is going on", adding that "we have to be very, very vigilant as to who we allow into this country".

In an interview with the Washington Post editorial board the day before the Brussels attack, he questioned the utility of the Nato alliance and said, "I know the outer world exists and I'll be very cognisant of that. But at the same time, our country is disintegrating, large sections of it, especially the inner cities."

Aside from tweets and headline-grabbing sound bites, the Republican candidates offered little of substance, even though this was the week when both Mr Cruz and Mr Trump unveiled their foreign policy teams.

Cruz says police must 'secure' US Muslim neighbourhoods

Trump reveals unorthodox foreign policy views

Image copyright AP

Both Democratic candidates adopted a sober tone, speaking of alliances with European countries, stepping up efforts to share intelligence, working with Arab allies and embracing American Muslims.

Hillary Clinton and Bernie Sanders may not agree on matters of foreign policy but they both upbraided Mr Cruz for his patrol proposal. President Barack Obama chimed in too, as he ended his historic visit to Cuba.

"As far as the notion of having surveillance of neighbourhoods where Muslims are present, I just left a country that engages in that kind of neighbourhood surveillance, which, by the way, the father of Senator Cruz escaped for America, the land of the free," said Mr Obama.

Mr Sanders said "there is a lot of work to be done to protect our country, as well as to protect our allies in Europe and elsewhere, by the way". But pressed on details, including on the alliance with Arab countries to counter the so-called Islamic State (IS), he remained vague and said none of it would be easy.

Image copyright AP

As a former secretary of state, Mrs Clinton gave the most comprehensive reaction at Stanford University, during a speech scheduled in reaction to the Brussels attacks.

She devoted a large chunks of her address to criticising the Republican candidates saying that: "If Mr Trump gets his way, it will be like Christmas in the Kremlin" and dismissed Mr Cruz's proposals as those of someone who was "in over [his] head".

Mrs Clinton spoke in detail about the importance of the Nato alliance, the need for an ''intelligence surge" but she gave few new policy prescriptions.

She was careful not to distance herself from the president who remains very popular with Democrats. She did repeat her call for a safe zone in Syria - the only public point of disagreement with President Obama - and was the only candidate to link an end to the conflict in Syria to the broader approach to dealing with the threat in Europe.

Image copyright EPA

Mr Trump immediately tweeted: "Just watched Hillary deliver a pre-packaged speech on terror. She's been in office fighting terror for 20 years — and look where we are!"

The comments were quickly dismissed by Clinton advisers.

"The last few days have been a test. The race is not be an entertainer-in-chief but to be commander-in-chief," said Nicholas Burns, Harvard professor and former state department official who currently advises Mrs Clinton. He said Mr Trump had lost his bearings when he questioned the role of Nato barely a day before the Brussels attack.

"You can't succeed in this fight unless you're doing it with 20, 30 countries. Does Trump want to do this alone?"

In a highly divisive election year, full of mud-slinging and name-calling, Democrats and members of the Republican establishment agree on one thing - they are aghast at the isolationism on display by Mr Trump and Mr Cruz. And it is the intra-GOP debate on foreign policy that is the most interesting to observe as it unfolds.

In an open letter earlier this month, 121 members of the GOP foreign policy establishment denounced Mr Trump's vision of "American influence and power in the world [as] wildly inconsistent and unmoored in principle. He swings from isolationism to military adventurism within the space of one sentence."

Image copyright Getty Images Image caption John Kerry visits the Brussels airport after the bombing

So the question now is how does the aftermath of the Brussels attack actually affect the campaign? Needless to say, each side believes it plays to their strengths as each claim they have the better answer to the security concerns and the long-term policy challenges.

Mrs Clinton is often described as a hawk, which is why some of the signatories of the open letter against Mr Trump have indicated they would be open to voting for Mrs Clinton as president if Trump is the Republican nominee.

But the co-ordinator of the letter, Elliot Abrams, a former deputy national security adviser to President George W Bush, now at the Council on Foreign Relations and an adviser to Mr Cruz, said the current mood in the country still "helps the Republican nominee, whether Trump or Cruz. Republicans still have an advantage on security issues and they appear tougher."

Mr Cruz and Mr Trump's approval ratings went up a few points after the Paris and San Bernardino attacks, although Mrs Clinton still leads by a wide margin when Americans are asked who they trust most on terrorism or in an international crisis.

This is where the isolationism of Mr Cruz and Mr Trump can end up being a disadvantage - the more complicated the crisis becomes, from Europe to Libya and Egypt, the less they will be able to argue that the only answer is to pull up the drawbridges.