Rebels in uniform near the Luhansk base promised safety for the officers if they surrendered and laid down their arms.
The rebels, who have seized government and police buildings across east Ukraine and hope to join the region to Russia, have waged increasingly aggressive attacks on government-held checkpoints and garrisons in an attempt to seize weapons and ammunition from Ukrainian forces.
Serhiy Astakhov, the spokesman for the border guard service, said that a preliminary assessment indicated that five rebels were killed and eight injured in the attack on the camp in Luhansk, a major city not far from the Russian border. He also said seven servicemen were injured, three seriously.
The initial attack by about 100 insurgents was met by firing from the border guards, and the number of attackers swelled to around 400 a few hours later. Mr Astakhov said the fighting was continuing and that the Ukrainian forces had sent an aircraft to the area, but still had been unable to quell the attack.
An Associated Press reporter saw at least one dead rebel soldier about a kilometre (1,000 yards) away from the base. Fellow fighters approached and broke into tears as they viewed the body.