A terminal device comprising: a transmission unit configured to perform transmission in a device-to-device communication in which a plurality of terminal devices communicate with each other directly; and a reception unit configured to receive, from a radio access network, a handover command for a handover from a source cell to a target cell in the radio access network, the handover command indicating a configuration for one of two modes for the device-to-device communication in the target cell, wherein: in a first mode of the two modes, a first transmission resource is used for the device-to-device communication, the first transmission resource being scheduled by the radio access network, in a second mode of the two modes, a second transmission resource is used for the device-to-device communication, the second transmission resource being selected by the transmission unit from a resource pool, the transmission unit is configured to perform the device-to-device communication in the second mode by using the resource pool, the configuration of the resource pool being included in the handover command, while a timer is running until expiry, the timer being started to measure a duration in response to reception of the handover command and stopped in a case of a success in the handover procedure, in a case that the transmission unit was instructed to perform the device-to-device communication in the first mode in the source cell. a transmission unit configured to perform transmission in a device-to-device communication in which a plurality of terminal devices communicate with each other directly; and a reception unit configured to receive, from a radio access network, a handover command for a handover from a source cell to a target cell in the radio access network, the handover command indicating a configuration for one of two modes for the device-to-device communication in the target cell, wherein: in a first mode of the two modes, a first transmission resource is used for the device-to-device communication, the first transmission resource being scheduled by the radio access network, in a second mode of the two modes, a second transmission resource is used for the device-to-device communication, the second transmission resource being selected by the transmission unit from a resource pool, the transmission unit is configured to perform the device-to-device communication in the second mode by using the resource pool, the configuration of the resource pool being included in the handover command, while a timer is running until expiry, the timer being started to measure a duration in response to reception of the handover command and stopped in a case of a success in the handover procedure, in a case that the transmission unit was instructed to perform the device-to-device communication in the first mode in the source cell. in a first mode of the two modes, a first transmission resource is used for the device-to-device communication, the first transmission resource being scheduled by the radio access network, in a second mode of the two modes, a second transmission resource is used for the device-to-device communication, the second transmission resource being selected by the transmission unit from a resource pool, the transmission unit is configured to perform the device-to-device communication in the second mode by using the resource pool, the configuration of the resource pool being included in the handover command, while a timer is running until expiry, the timer being started to measure a duration in response to reception of the handover command and stopped in a case of a success in the handover procedure, in a case that the transmission unit was instructed to perform the device-to-device communication in the first mode in the source cell.