The Taliban have gained the upper hand in Afghanistan, the top American commander there said, forcing the U.S. to change its strategy in the eight-year-old conflict by increasing the number of troops in heavily populated areas like the volatile southern city of Kandahar, the insurgency's spiritual home.

Gen. Stanley McChrystal warned that means U.S. casualties, already running at record levels, will remain high for months to come.

In...