Republican candidate Joe Miller, a Senate candidate for the November 2 Congressional elections, made the comments when discussing immigration at a town hall meeting reported by the Anchorage Daily News.
Miller said that, when he was serving in the US military, he spent time at the Fulda Gap near Frankfurt, a key point on the frontline between the then East and West Germany.
"That was .. when the Wall was still up between East and West Germany, he said in an audio clip on the Alaska newspaper's website.
"East Germany was very, very able to reduce the flow," Miller said, adding: "Obviously there were other things that were involved, but we have the capacity as a great nation to obviously secure our border.
"If East Germany could do it, we could do it," Miller said, adding: "Frankly my perspective is, you've got to build a fence."
However, Miller failed to mention that East Germany used deadly force along the Wall to keep people from leaving the communist country rather than enter it.
Miller's spokesman did not immediately return requests for a comment on the remarks, which come barely two weeks before midterm elections across the United States next month.
Immigration is a potent issue in the United States, still struggling to recover from the global economic crisis. While some fret about foreigners potentially taking scarce US jobs, most Americans have a hard time opposing immigration energetically when most are descended from immigrants.