A powerful earthquake in western Colombia on Monday shook the South American nation and neighboring Ecuador, prompting people to evacuate homes and buildings.