During the lively CNN GOP debate on Tuesday, many candidates took on Donald Trump's position of securing the southern border, but Sen. Ted Cruz (R-Texas) was able to copy the billionaire's ideas and make him the butt of his joke.

During a conversation about immigration Cruz said he will build a wall, but he'll get someone besides Mexico to pay for it.

“If I'm elected president, we will secure the border, we will triple the border patrol, we will get a wall that works, and I’ll get Donald Trump to pay for it," the Texas senator said.

The billionaire wasn't offended though, he laughed and said "I'll build it!"

It was one of the few lighter moments of the debate on immigration. Cruz and Sen. Rand Paul (R-Ky.) repeatedly hit Sen. Marco Rubio (R-Fla.) for repeatedly voting against border security, while Gov. Jeb Bush (R-Fla.) and Trump sparred over his comments on Muslim immigration.

Watch the clip below: