Here is a guide in their own words to how May and Corbyn responded to each attack, and what - if any - was the fallout.
March 22: Parliament attack
A lone attacker drove his car across Westminster Bridge, mounting the pavement and mowing down pedestrians before running into the precincts of Parliament and stabbing a police officer. He was shot dead. Five people died.
May, who was in the House of Commons at the time of the attack and was whisked away in a Jaguar, convened the Government's emergency Cobra committee and appeared that evening, dressed in black, outside her central London office to make a statement. She said not to allow the "voices of hate and evil to drive us apart".
May's message: "Tomorrow morning, Parliament will meet as normal. We will come together as normal," she said. "Londoners - and others from around the world who have come here to visit this great city - will get up and go about their day as normal. They will board their trains, they will leave their hotels, they will walk these streets, they will live their lives."
What Corbyn said: "I know that Londoners and people across the country will stand together in defence of our values and diversity".
May 22: Manchester bombing
The British-born son of Libyan refugees detonated a bomb in Manchester as teenagers, parents and their young children left a pop concert. Twenty-two people died.
May stayed up most of the night coordinating the response to the attack and appeared outside her residence the following morning and later in the evening to announce the threat level would be raised to "critical," the highest level.
May's message: "We will take every measure available to us and provide every additional resource we can to the police and the security services as they work to protect the public. And while we mourn the victims of last night's appalling attack, we stand defiant. The spirit of Manchester and the spirit of Britain is far mightier than the sick plots of depraved terrorists, that is why the terrorists will never win and we will prevail."'
What Corbyn said: "This is an appalling act of violence against people, and it must be totally and unreservedly and completely condemned. We must support those people who have suffered so much. In these circumstances we have to come together."
May 26: Campaign hiatus
Campaigning was then suspended for three days and, when it restarted, Corbyn wore a black tie as he delivered a speech on UK foreign policy in central London. "The 'war on terror' is simply not working," he said as he made the case for an overhaul of foreign policy and criticised May's Government for squeezing police budgets.
"Many experts, including professionals in our intelligence and security services, have pointed to the connections between wars our Government has supported or fought in other countries, such as Libya, and terrorism here at home," Corbyn, a long-time critic of UK foreign interventions, said.
At a meeting of Group of Seven leaders in Sicily, May was swift and brutal in her response as polls showed her lead slipping. "I have been here today at the G7 working with other international leaders to fight terrorism. At the same time Jeremy Corbyn has said that terror attacks in Britain are our own fault," May said, breaking with the show of cross-party unity after the attack.
"The choice people face in the general election has just become starker," she said. "It's a choice between me working constantly to protect the national interest and working for security and Jeremy Corbyn who frankly isn't up to the job."
Election home stretch
On June 2, in a question and answer sessions with voters on BBC TV, Corbyn was repeatedly asked about his failure to condemn bombings by the Irish Republican Army, a terrorist group that carried out a series of attacks in Britain. He was not asked about Islamist extremism.
The following day, a white van drove into pedestrians in central London. Three men with fake suicide vests began to knife people on a Saturday night out. Seven were killed before the three attackers were shot dead by police, eight minutes after they were called.
This time, May cut to the chase about the need to to have "some difficult and often embarrassing conversations" as US President Donald Trump tweeted from the US. that "we must stop being politically correct".
Corbyn, in the meantime, said: "I can't recall any other election where there has been anything like this. This has got to be the worst."
- Bloomberg