Gen Abdel Aziz al-Fagham was visiting a friend when he had a row with Mamdouh bin Meshaal Al Ali on Saturday night.
A police statement said Ali left the house in Jeddah to return with a gun with which he opened fire.
He was shot dead after refusing to surrender to police, the statement said. Gen Fagham died of his wounds in hospital. Seven people were injured.
They include two people at the friend's house Gen Fagham was visiting, as well as five security personnel involved in the shoot-out.
Gen Fagham was well known among Saudis.
He was close to King Salman and his long service included serving as the personal bodyguard of late King Abdullah, too.
Tributes on social media described him as a "hero" and "guardian angel".
King Salman acceded to the throne in 2015 at the age of 79.
Many observers suggest that his son, Prince Mohammed bin Salman, wields real power in Saudi Arabia.