Answer
$(x-3)^2(x+3)$
Work Step by Step
Place the four terms into two groups. Then pull out the greatest common factor of each. Then factor $x^2-9$ using $A^2-B^2=(A+B)(A-B)$. Then simplify further.
$x^3-3x^2-9x+27$
$(x^3-3x^2)-(9x-27)$
$x^2(x-3)-9(x-3)$
$(x-3)(x^2-9)$
$(x-3)(x-3)(x+3)$
$(x-3)^2(x+3)$