The US homeland security department confirmed that a border patrol agent had fired shots.