Protein knots and slipknots, mostly regarded as intriguing oddities, are gradually being recognized as significant structural motifs. Recent experimental results show that knotting, starting from a fully extended polypeptide, has not yet been observed. Understanding the nucleation process of folding knots is thus a natural challenge for both experimental and theoretical investigation. In this study, we employ energy landscape theory and molecular dynamics to elucidate the entire folding mechanism. The full free energy landscape of a knotted protein is mapped using an all-atom structure-based protein model. Results show that, due to the topological constraint, the protein folds through a three-state mechanism that contains (i) a precise nucleation site that creates a correctly twisted native loop (first barrier) and (ii) a rate-limiting free energy barrier that is traversed by two parallel knot-forming routes. The main route corresponds to a slipknot conformation, a collapsed configuration where the C-terminal helix adopts a hairpin-like configuration while threading, and the minor route to an entropically limited plug motion, where the extended terminus is threaded as through a needle. Knot formation is a late transition state process and results show that random (nonspecific) knots are a very rare and unstable set of configurations both at and below folding temperature. Our study shows that a native-biased landscape is sufficient to fold complex topologies and presents a folding mechanism generalizable to all known knotted protein topologies: knotting via threading a native-like loop in a preordered intermediate.