We study the three-quark static potential in perturbation theory in QCD. A complete next-to-leading order calculation is performed in the singlet, octets and decuplet channels and the potential exponentiation is demonstrated. The mixing of the octet representations is calculated. At next-to-next-to-leading order, the subset of diagrams producing three-body forces is identified in Coulomb gauge and its contribution to the potential calculated. Combining it with the contribution of the two-body forces, which may be extracted from the quark-antiquark static potential, we obtain the complete next-to-next-to-leading order three-quark static potential in the colour-singlet channel.