No.6, Shingeki no Kyojin Recommendations
INCREDIBLY similar to this anime. The human race has retreated behind a wall, and are now being attacked by a threat that could wipe humanity out if they allowed. Main protagonist has to figure out how to stop it. Early in the series they are affected by said threat, but not killed.
People live inside a city surrounded by a giant wall. The world outside the wall is ruined by the last great war and virtually inhabitable. The wall does play quite a big role. A killer species threatens the lives of everyone within the walls. Quite a lot of really tragic deaths occur and a good amount of blood is shown, actually. Some parts leave your heart feeling shattered.
Caged inside of the walls .