That situation is called a "snap-back." The rule in go is that you can play a move that would be suicide if it would capture an enemy's stone(s). If that is the case then the move is not suicide, instead the enemy's stone(s) are captured.
You can think of it like the standard ko situation:
$$ White at 'a' is not suicide
$$ . . . . . .
$$ . . X O . .
$$ . X a X O .
$$ . . X O . .
$$ . . . . . .
$$
- Click Here To Show Diagram Code
[go]$$ White at 'a' is not suicide
$$ . . . . . .
$$ . . X O . .
$$ . X a X O .
$$ . . X O . .
$$ . . . . . .
$$[/go]
When white plays it looks like the white stone has no liberties.
However, because it was white who played the stone, first the black stone is captured. Then you count the liberties that the white stone has.
$$ The black stone is removed
$$ . . . . . .
$$ . . X O . .
$$ . X W X O .
$$ . . X O . .
$$ . . . . . .
$$
- Click Here To Show Diagram Code
[go]$$ The black stone is removed
$$ . . . . . .
$$ . . X O . .
$$ . X W X O .
$$ . . X O . .
$$ . . . . . .
$$[/go]