We construct Fatou–Bieberbach domains in $\mathbb{C}^{n}$ for$n$>1 which contain a given compact set$K$and at the same time avoid a totally real affine subspace$L$of dimension <$n$, provided that$K$∪$L$is polynomially convex. By using this result, we show that the domain $\mathbb{C}^{n}\setminus\mathbb{R}^{k}$ for 1≤$k$<$n$enjoys the basic Oka property with approximation for maps from any Stein manifold of dimension <$n$.