Original: He was assassinated by the Muslim Brotherhood while in office.
Simplified: He was assassinated by the Muslim Brotherhood while he was Prime Minister.