A method of producing a target nucleic acid having a predefined sequence, the method comprising: (a) providing a first mixture comprising: (i) a first pool of oligonucleotides comprising a first plurality of terminal oligonucleotides comprising a sequence identical to the 5' end of a first target nucleic acid, a second plurality of terminal oligonucleotides comprising a sequence identical to the 3' end of the first target nucleic acid, and a first plurality of internal oligonucleotides each comprising a sequence identical to a different portion of the first target nucleic acid, each of the terminal and internal oligonucleotides having an overlapping region with a next oligonucleotide, the terminal and internal oligonucleotides in the first pool together comprising the first target nucleic acid; wherein each terminal and internal oligonucleotide further comprises a flanking sequence comprising a common primer recognition site and a restriction endonuclease recognition site at each end of the oligonucleotide; and (ii) a restriction enzyme that recognizes the restriction endonuclease recognition site, wherein the restriction enzyme is a Type IIS restriction enzyme, (b) exposing the first mixture to a ligase and subjecting the first mixture comprising the ligase to conditions suitable to promote concurrent restriction enzyme digestion and ligation, thereby generating the first target nucleic acid, which by design is not a substrate of the restriction enzyme. (a) providing a first mixture comprising: (i) a first pool of oligonucleotides comprising a first plurality of terminal oligonucleotides comprising a sequence identical to the 5' end of a first target nucleic acid, a second plurality of terminal oligonucleotides comprising a sequence identical to the 3' end of the first target nucleic acid, and a first plurality of internal oligonucleotides each comprising a sequence identical to a different portion of the first target nucleic acid, each of the terminal and internal oligonucleotides having an overlapping region with a next oligonucleotide, the terminal and internal oligonucleotides in the first pool together comprising the first target nucleic acid; wherein each terminal and internal oligonucleotide further comprises a flanking sequence comprising a common primer recognition site and a restriction endonuclease recognition site at each end of the oligonucleotide; and (ii) a restriction enzyme that recognizes the restriction endonuclease recognition site, wherein the restriction enzyme is a Type IIS restriction enzyme, (i) a first pool of oligonucleotides comprising a first plurality of terminal oligonucleotides comprising a sequence identical to the 5' end of a first target nucleic acid, a second plurality of terminal oligonucleotides comprising a sequence identical to the 3' end of the first target nucleic acid, and a first plurality of internal oligonucleotides each comprising a sequence identical to a different portion of the first target nucleic acid, each of the terminal and internal oligonucleotides having an overlapping region with a next oligonucleotide, the terminal and internal oligonucleotides in the first pool together comprising the first target nucleic acid; wherein each terminal and internal oligonucleotide further comprises a flanking sequence comprising a common primer recognition site and a restriction endonuclease recognition site at each end of the oligonucleotide; and (ii) a restriction enzyme that recognizes the restriction endonuclease recognition site, wherein the restriction enzyme is a Type IIS restriction enzyme, (b) exposing the first mixture to a ligase and subjecting the first mixture comprising the ligase to conditions suitable to promote concurrent restriction enzyme digestion and ligation, thereby generating the first target nucleic acid, which by design is not a substrate of the restriction enzyme.