Method and device for processing an AT command when a mobile phone loses coverage or is performing mode switching. If the mobile phone camps on a first mode after being powered on, a protocol stack sets current and backup modes as the first mode; after the mobile phone loses coverage, if there is an AT command to be issued, an ATI module acquires the backup mode and issues the AT command to NAS of the backup mode for processing; and when the mobile phone switches from the first mode to a second mode, after modifying the current and backup modes to the second mode, an general control module notifies the NAS of the first mode to perform a switching operation, when there is an AT command to be issued, the ATI module delivers the AT command to an NAS of the second mode for caching and processing after the switching.