A lock device of a fuel tank cap comprising: a cap configured to open and close a fuel filler port by moving between a closed position where the fuel filler port leading to a fuel tank of a vehicle is blocked and an open position where the fuel filler port is open; an operating unit configured to be operated by an operator; a fastening unit movable in conjunction with an operation of the operating unit, the fastening unit configured to move between a fastening position where the cap blocking the fuel filler port is held and an allowing position where the fastening is released to allow the cap to open; a lock unit configured to lock movement of the fastening unit from the fastening position to the allowing position or release the lock to allow the movement of the fastening unit from the fastening position to the allowing position; characterised in that the lock device comprises a detection switch configured to detect start of the movement of the fastening unit accompanying the operation of the operating unit, wherein: the lock device performs unlocking by the lock unit on condition that the detection switch detects the start of the movement of the fastening unit; and the fastening unit includes a first fastening unit which moves by receiving an operating force of the operating unit and of which the start of movement can be detected by the detection switch; and a second fastening unit which enables locking by the lock unit and which is integrally moved with the first fastening unit after the first fastening unit is moved by a predetermined dimension so that the second fastening unit can be moved from the fastening position to the allowing position. a cap configured to open and close a fuel filler port by moving between a closed position where the fuel filler port leading to a fuel tank of a vehicle is blocked and an open position where the fuel filler port is open; an operating unit configured to be operated by an operator; a fastening unit movable in conjunction with an operation of the operating unit, the fastening unit configured to move between a fastening position where the cap blocking the fuel filler port is held and an allowing position where the fastening is released to allow the cap to open; a lock unit configured to lock movement of the fastening unit from the fastening position to the allowing position or release the lock to allow the movement of the fastening unit from the fastening position to the allowing position; characterised in that the lock device comprises a detection switch configured to detect start of the movement of the fastening unit accompanying the operation of the operating unit, wherein: the lock device performs unlocking by the lock unit on condition that the detection switch detects the start of the movement of the fastening unit; and the fastening unit includes a first fastening unit which moves by receiving an operating force of the operating unit and of which the start of movement can be detected by the detection switch; and a second fastening unit which enables locking by the lock unit and which is integrally moved with the first fastening unit after the first fastening unit is moved by a predetermined dimension so that the second fastening unit can be moved from the fastening position to the allowing position. the lock device performs unlocking by the lock unit on condition that the detection switch detects the start of the movement of the fastening unit; and the fastening unit includes a first fastening unit which moves by receiving an operating force of the operating unit and of which the start of movement can be detected by the detection switch; and a second fastening unit which enables locking by the lock unit and which is integrally moved with the first fastening unit after the first fastening unit is moved by a predetermined dimension so that the second fastening unit can be moved from the fastening position to the allowing position. a first fastening unit which moves by receiving an operating force of the operating unit and of which the start of movement can be detected by the detection switch; and a second fastening unit which enables locking by the lock unit and which is integrally moved with the first fastening unit after the first fastening unit is moved by a predetermined dimension so that the second fastening unit can be moved from the fastening position to the allowing position.