The incident happened on Friday night after the militants raided a camp used by a border patrol police unit, according to a statement. No security personnel were injured in the operation, it added.
"Our officers effectively engaged them and with quick reinforcement from special forces, the attackers were repulsed," police said. "The enemy suffered three fatalities during the incident."
Al Shabaab frequently stages attacks in Kenya to put pressure on Nairobi to withdraw its soldiers from Somalia.
Some of the group's most deadly strikes in Kenya include an 2015 attack on a university in which 148 people, mostly students, died, while a 2013 assault on the Westgate shopping mall in the capital Nairobi killed 67 people.
Al Shabaab is fighting to topple Somalia's Western-backed central government so it can install its own government based on its strict interpretation of the Islamic sharia law.
A Kenyan military contingent is part of the African Union (AU)-mandated peace keeping force AMISOM that helps defend the central government.