Some days at sunset, the whole of Buenos Aires seems to be moving to the rhythm of a tango soundtrack – old gents deal cards in corner bars while Carlos Gardel’s voice wafts out of a transistor radio, a child plays the bandoneón (accordion) for tourists on the Subte, and local dancers warm up for a nightly milonga (social dance) as the beat-up sound system plays tango classics.

This iconic dance and musical form is experiencing a revival in Buenos Aires. Not only do the nostalgic old tango dancers have a renewed sense of pride in the tradition, foreigners are doubly entranced by the melancholic tango. Walk past the Sunday night milonga in San Telmo's Plaza Dorrego and you will see eager young travellers putting their first tango lessons to the test, dancing cheek-to-cheek with distinguished-looking partners three times their age.

Social dances in tango dance halls are particularly popular, and while the afternoon milonga at Confitería Ideal attracts a sizable crowd, the Saturday night milonga (which runs until 4 am) is packed.

For many years, tango was despised by the porteño (Buenos Aires locals) elite and considered a vulgar pastime of the working class. The dance had humble beginnings, to be sure. It is said that it got going at the end of the 19th Century in Buenos Aires' brothels, where a melting pot of poor immigrants and country folk danced together while waiting their turn to slip behind the bedroom door.The tango drew on stylistic influences from African, Spanish, Italian and traditional Argentine dance forms. Developed by men who had left their families behind to start a life in Argentina's bustling capital city, the dance expressed machismo, passion, longing and a fighting edge - and was set to an emerging sound rooted in Spanish and Italian melodies, criollo (Argentine-born) verse and Afro-Uruguayan candombe (a drum-based rhythm).

When Argentine musicians took tango to Paris at the beginning of the 20th Century, it quickly swept through the ballrooms of Europe. By 1913, everyone wanted to dance the tango, and only then did the porteño aristocrats embrace the trend in the upscale dance halls of Recoleta in Buenos Aires. In 1917, Carlos Gardel recorded the poetic "Mi Noche Triste" (My Sad Night). Considered the genre's first anthem, it featured Gardel's crooning, charismatic voice and set a new standard - laments of lost love, faraway mothers and changing barrios would become the musical expression of the porteño psyche.

The genre continued to transform throughout the following decades with the introduction (and later decline) of orchestras. By the 1970s, the legendary Astor Piazzolla, a master on the bandoneón, was moving tango out of the dance halls and blending the form with jazz and classical music in international music venues. After the economic crisis of 2001, former rocker Daniel Melingo experimented with adding a harder edge to tango and trading the old-fashioned text for contemporary lyrics.

Music collectives Bajofondo Tango Club (now known simply as Bajofondo) and Paris-based Gotan Project ignited tango electrónica, an energetic and sensual music form that has become extremely popular in Buenos Aires and abroad.

If tango tops your must-do list, start by seeing a tango show or stopping by a milonga. Private and group lessons are available in dance halls and advertised throughout the city.

The article 'Anyone for tango?' was published in partnership with Lonely Planet.