BAGHDAD—U.S. and Iraqi leaders signaled that their governments are working on ways to continue joint military training and cooperation after the last American troops have left the country this month.

Vice President Joe Biden, visiting Baghdad to mark the withdrawal and discuss the future U.S. role here, said at a meeting of American and Iraqi officials that the U.S. will provide security assistance at Baghdad's request.

Iraqi...