The Si(001) surface morphology during ion sputtering at elevated temperatures and solid phase epitaxy following ion sputtering at room temperature has been investigated using scanning tunneling microscopy. Two types of antiphase boundaries form on Si(001) surfaces during ion sputtering and solid phase epitaxy. One type of antiphase boundary, the AP2 antiphase boundary, contributes to the surface roughening. AP2 antiphase boundaries are stable up to 700 o C, and ion sputtering and solid phase epitaxy performed at 700 o C result in atomically flat Si(001) surfaces.