Chris Msando, who was in charge of the electronic voting systems at Kenya's Independent Electoral and Boundaries Commission (IEBC), was murdered at the weekend along with a young woman.
Mr. Msando, who was in his 30s, had appeared on television only hours before he was killed, talking about how the IEBC was prepared for the election and was determined to make it a free and fair poll.
Mr. Kenyatta, 55, is the son of Kenya's first president, Jomo Kenyatta, but under his rule the country has become mired in corruption, the economy has sagged and it has been unable to stop persistent terrorist attacks.
In April 2015 the Islamist al-Shabaab crossed the border from neighboring Somalia and attacked a university in Garissa, killing 148 people.
Mr. Odinga, 72, who is from the Luo tribe, has tried and failed several times to be elected president.
After the December 2007 election, when he lost to Mwai Kibaki and claimed there had been widespread vote-rigging, there was widespread violence between the Luo and the Kikuyu tribe, which led to the deaths of more than 1,000 people.
Hundreds were forced to flee and it was months before the violence stopped.
Mr. Kibaki and Mr. Kenyatta are both Kikuyus and many other tribes in Kenya feel they have dominated the country since it won independence from Britain in 1963.
Mr. Odinga and Mr. Kenyatta are neck-and-neck in polls ahead of next week's election.
In an apparently unconnected incident, the residence of Deputy President William Ruto came under attack over the weekend.
This year, in an effort to dismiss claims of vote-rigging, the IEBC had introduced a computer system — Kenya Integrated Elections Management System — which can identify voters, transmit results from outlying regions and tally up the final figures.
Mr. Msando, was in charge of the system, had reported several death threats before he was murdered. He went missing on Friday (July 28) and his Land Rover Discovery was found abandoned in the Nairobi suburb of Roysambu. His body, stripped to his underwear, was found on Sunday (July 30) and identified the following day. His left arm had been broken and he had been tortured and shot.
The naked body of a 21-year-old woman, Carol Ngumbu, who he is understood to have been dating, was also found alongside him. She too had been shot.
Mr. Msando's wife, Elsa Auma, had reported him missing on Sunday morning.
The British High Commissioner, Nic Hailey, and US ambassador Bob Godec both condemned the killing and offered the assistance of the FBI and Scotland Yard to the Kenyan government.
"We extend our deepest condolences to his family, friends and the entire IEBC team," said Mr. Godec, in a statement.
"It is critical that Kenya have free, fair, credible and peaceful elections on August 8, and protection for IEBC staff is essential to achieving this goal. We welcome the government of Kenya's commitment to investigating the murder. We have offered our assistance in the investigation," he added.
IEBC Chairman Wafula Chebukati said Mr. Msando sent a text message to one of his colleagues at around 3am on Saturday (July 29).
He had been due to meet colleagues later that day.
"The SMS suggests that he was conscious and fully aware of his itinerary for that day," said Mr. Chebukati.
"He had been tortured and we demand to know who killed him and why," said Mr. Chebukati.
Mr. Chebukati demanded a thorough investigation into the murders and asked the government to provide security to IEBC employees in the run-up to the election.
Ms. Ngumbu's mother, Alice Nduruka, said her daughter had been due to graduate from medical college in December.
"When she told me she was going out on Friday I did not expect could receive such news," she said.