A variable valve mechanism of an internal combustion engine, comprising: a rocker arm including an input member driven by a cam and an output member that drives a valve when swung; a switching device that includes a first pin hole provided in the input member, a second pin hole provided in the output member, and a switching pin, and that switches a drive state of the valve by displacing the switching pin between a coupling position at which the switching pin extends between the first pin hole and the second pin hole and a non-coupling position at which the switching pin does not extend between the first pin hole and the second pin hole; and a lost motion spring that urges the input member toward the cam at a non-coupled time when the switching pin is disposed at the non-coupling position, wherein a displacement clearance in a direction of relative displacement of the input member with respect to the output member at the non-coupled time is formed between an inner peripheral surface of the first or second pin hole and an outer peripheral surface of the switching pin to permit the relative displacement in a range of the displacement clearance at a coupled time when the switching pin is disposed at the coupling position so that a tappet clearance (c) is not formed between a base circle of the cam and the input member with the input member urged toward the cam by the lost motion spring also at the coupled time; characterized in that the cam has a profile including, as seen in a graph having a horizontal axis indicating a rotational angle (θ) of the cam and a vertical axis indicating a projection height from the base circle, two uniform velocity sections in which an inclination (P') of the profile is constant and which are provided on an inner side of connection sections provided at both end portions of a nose section, and a main lift section provided on an inner side of the uniform velocity sections; and the displacement clearance is formed to have such a size that permits the relative displacement only in ranges (Bc), which are included in both the connection sections and the uniform velocity sections, and that does not permit the relative displacement in the main lift section at the coupled time. a rocker arm including an input member driven by a cam and an output member that drives a valve when swung; a switching device that includes a first pin hole provided in the input member, a second pin hole provided in the output member, and a switching pin, and that switches a drive state of the valve by displacing the switching pin between a coupling position at which the switching pin extends between the first pin hole and the second pin hole and a non-coupling position at which the switching pin does not extend between the first pin hole and the second pin hole; and a lost motion spring that urges the input member toward the cam at a non-coupled time when the switching pin is disposed at the non-coupling position, wherein a displacement clearance in a direction of relative displacement of the input member with respect to the output member at the non-coupled time is formed between an inner peripheral surface of the first or second pin hole and an outer peripheral surface of the switching pin to permit the relative displacement in a range of the displacement clearance at a coupled time when the switching pin is disposed at the coupling position so that a tappet clearance (c) is not formed between a base circle of the cam and the input member with the input member urged toward the cam by the lost motion spring also at the coupled time; the cam has a profile including, as seen in a graph having a horizontal axis indicating a rotational angle (θ) of the cam and a vertical axis indicating a projection height from the base circle, two uniform velocity sections in which an inclination (P') of the profile is constant and which are provided on an inner side of connection sections provided at both end portions of a nose section, and a main lift section provided on an inner side of the uniform velocity sections; and the displacement clearance is formed to have such a size that permits the relative displacement only in ranges (Bc), which are included in both the connection sections and the uniform velocity sections, and that does not permit the relative displacement in the main lift section at the coupled time.