A variable valve gear for an internal combustion engine, comprising: a cam base portion integrally or separately provided in a camshaft, and immovably fixed to the camshaft; a cam lobe portion connected to the cam base portion so as to swing and shift between a first state where the cam lobe portion is positioned to project from an outer circumference of the base portion and a second state where the cam lobe portion is positioned to be lower than the cam base portion in the first state; a lock mechanism locking the cam lobe portion in the first and second state; and a biasing member biasing the cam lobe portion to be shifted to the first state, to such an extent that the cam lobe portion is shifted to the second state by reaction force from a cam follower when the locking mechanism is unlocked, characterized in that the locking mechanism comprises: a locking member held in a holding hole, of the cam lobe portion, extending in an axial direction of the camshaft; a first locking hole formed in the cam base portion, and arranged in the axial direction in the first state; a second locking hole formed in the cam base portion, and arranged in the axial direction in the second state; a first spring biasing the locking member to be inserted into the first locking hole in the first state; a second spring biasing the locking member to recede from the second locking hole in the second state; a first path formed in the cam base portion, and is configured to exert a hydraulic pressure on the locking member to be disengaged from the first locking hole in the first state; and a second path formed in the cam base portion, and is configured to exert a hydraulic pressure on the locking member to be inserted into the second locking hole in the second state. a cam base portion integrally or separately provided in a camshaft, and immovably fixed to the camshaft; a cam lobe portion connected to the cam base portion so as to swing and shift between a first state where the cam lobe portion is positioned to project from an outer circumference of the base portion and a second state where the cam lobe portion is positioned to be lower than the cam base portion in the first state; a lock mechanism locking the cam lobe portion in the first and second state; and a biasing member biasing the cam lobe portion to be shifted to the first state, to such an extent that the cam lobe portion is shifted to the second state by reaction force from a cam follower when the locking mechanism is unlocked, characterized in that the locking mechanism comprises: a locking member held in a holding hole, of the cam lobe portion, extending in an axial direction of the camshaft; a first locking hole formed in the cam base portion, and arranged in the axial direction in the first state; a second locking hole formed in the cam base portion, and arranged in the axial direction in the second state; a first spring biasing the locking member to be inserted into the first locking hole in the first state; a second spring biasing the locking member to recede from the second locking hole in the second state; a first path formed in the cam base portion, and is configured to exert a hydraulic pressure on the locking member to be disengaged from the first locking hole in the first state; and a second path formed in the cam base portion, and is configured to exert a hydraulic pressure on the locking member to be inserted into the second locking hole in the second state. a locking member held in a holding hole, of the cam lobe portion, extending in an axial direction of the camshaft; a first locking hole formed in the cam base portion, and arranged in the axial direction in the first state; a second locking hole formed in the cam base portion, and arranged in the axial direction in the second state; a first spring biasing the locking member to be inserted into the first locking hole in the first state; a second spring biasing the locking member to recede from the second locking hole in the second state; a first path formed in the cam base portion, and is configured to exert a hydraulic pressure on the locking member to be disengaged from the first locking hole in the first state; and a second path formed in the cam base portion, and is configured to exert a hydraulic pressure on the locking member to be inserted into the second locking hole in the second state.