This paper mainly investigates consensus and formation control of second-order multiagent system with undirected communication graph. A nonlinear protocol is proposed as an extension of general linear protocols that have been widely studied. In order to achieve formation control, a formation control strategy corresponding to the nonlinear protocol is designed too. The sufficient conditions of consensus and formation are derived based on LaSalle's invariance principle. Simulation examples are provided to illustrate that the second-order multiagent with the nonlinear protocol can achieve consensus and formation.