Handling of integrity check failure in a wireless communication system can
safely send the mobile station to the idle mode upon detection of
security failure. Alternatively or in addition, attempts to recover from
the security failure situation can be enabled without forcing the mobile
station to enter idle mode. The mobile station autonomously transitions
to idle mode when the integrity check failure is detected a certain
threshold number `X` times during a specified period `Y`. Whereupon, the
mobile station initiates the Radio Resource Control (RRC) connection
re-establishment procedure after integrity check failure is detected. In
the RRC connection re-establishment procedure, the security parameters
are re-initialized to provide a possibility to recover from the failure
situation.