On the morning of May 10 1800, Francisco Goya, First Court Painter to the King, was summoned from his Madrid home to the royal retreat of Aranjuez, some 30 miles south. His mission? To paint the masterpiece we now know as The Family of Charles IV, a group portrait of the Spanish king, his queen, six children, first grandchild and other family members.
The idea was to mark the new century with pictorial proof that the Bourbon dynasty was in vigorous health and fit to rule well into the future. This was deemed crucial in the wake of the French Revolution and recent guillotining of Louis XVI (Charles IV's first cousin) in Paris. With the political climate in Europe was unprecedentedly convulsive, remaining monarchies felt compelled to affirm their legitimacy.
Goya chose as his model the royal painting par excellence, Las Meninas (1656) by Velazquez, harking back to the more certain reign of Philip IV. Yet, unlike that work, where the figures are placed in careful recession, in Goya's portrait the royal family are set within a shallow space not unlike a wedding photo. Pushing them forward towards the viewer suggests - notwithstanding the regal costumes and jewellery - a shared space between us and the Spanish rulers.
"The royals are mad about me", Goya declared in a letter to a friend. He was right - a delighted Charles would give the painting pride of place in the King's Antechamber in the Royal Palace in Madrid, where ministers, ambassadors and other dignitaries waited before an audience with the monarch.
Sadly, The Family of Charles IV (which never leaves the Prado Museum) will not be travelling to London next week for the biggest exhibition of Goya's portraiture ever mounted. Some 70 of the 160 portraits he painted will appear in the National Gallery's autumn blockbuster, which amounts to a who's who of Spanish society in the late-17th and early-18th century.
We'll meet Francisco de Cabrarrus, the distinguished Finance Minister; the Duchess of Alba, one of Spain's wealthiest and most beautiful society grandees; Don Luis de Bourbon, the king's brother exiled from court for excessive womanising; and many others.
Few of us would have heard of these figures without their commemoration by Goya. It's his brilliance, above all, that has earned them their posterity. Anyone who was anyone in that era wanted him to paint their portrait.
Goya was court painter from 1786 to 1824, serving four successive monarchs: the three Bourbons (Charles III, his son Charles IV and grandson Ferdinand VII) and also the interloper, Joseph Bonaparte (Napoleon's brother, Joseph I), who deposed Ferdinand and inserted himself on the throne between 1808 and 1814, after France's successful invasion of Spain.
To maintain a position at court during such turbulent times that even kings struggled to maintain theirs, was no mean feat. One can only imagine the political adroitness and ambition Goya must have needed to achieve it.
Not that he was ever one for straightforward flattery. Goya brought to his portraits an unprecedented realism and minute scrutiny; he made portraiture more about the person than their role. In contrast to his predecessor as First Court Painter, Anton Raphael Mengs, he rejected glorification in favour of psychological insight into his sitters. Goya did melancholy, pride, vulnerability, fortitude... His use of a plain, dark background further emphasised the sense of souls being searched.
Consider his painting of the Duke of Wellington in 1812. Where we might have expected to see the sitter triumphant after capturing Madrid in the Peninsular Wars, instead we see a man exhausted - haunted even - by the fighting he'd just witnessed.
What's more, unlike so many painters (think of Reynolds or Gainsborough in this country), Goya never resorted to formula. Each portrait seems to be conceived differently. Often it's the little touches that make all the difference. In 1788's Charles III in Hunting Dress, for instance, the king is relaxed and content after an afternoon's hunt. The white glove in his right hand droops like a fading lily: a far cry from the royal spectre or baton of command we're accustomed to seeing.
Goya's signature brushstrokes were the loose, darting type that coalesce marvellously when viewed at a distance. Largely self-taught, he believed in stylistic freedom and always claimed Nature was his greatest teacher. A strict curriculum rooted in geometry and perspective was wrong, he thought, as "to make everyone study in the same way... seriously harms an artist's development". This was part of his famous speech to Spain's Royal Academy in 1792 in which he declared "There are no rules for Painting", heralding the advent of Modernism a century or so later.
Goya was born into a relatively humble family in 1746, in the village of Fuentetodos in Northern Spain. His father was a gilder, whose contacts in the nearby city of Zaragoza helped the teenage Goya gain a painting apprenticeship there.
He was never officially trained and, as a young man, actually twice failed the Royal Academy entrance exam. After a brief sojourn in Italy and success decorating churches in Zaragoza, he got his big break as a designer of tapestries for the walls of royal residences.
By 1775 he had settled in Madrid. Though commissioned by those of all creeds, he now befriended the leading lights of Spanish liberal society: lawyers, philosophers, economists, playwrights. Coming to London are a wonderful pair of portraits of the ministers, Gaspar Melchor de Jovellanos and Francisco de Saveedra, representing two different sides of the political coin. Both are seated at a desk, but where the former (epitome of the contemplative statesman) looks like he has been interrupted mid-thought, the latter (epitome of the active statesman) looks animated, as though interrupted mid-conversation with a colleague just out of sight.
Spain was then a land where the Inquisition was still practiced, and Goya would attack the abuses and corruptions of the Catholic Church in an etchings series called Los Caprichos. Along with other so-called "Illustrados" (enlightened ones), Goya was something of an Enlightenment figure, striving hard to make Spain more progressive.
Of course, the irony is that many remember him, in contrast, as the Romantic artist supreme. One who, after losing both his wife Josefa and much of his hearing to meningitis in the annus horribilis of 1792, grew increasingly introspective and produced such works as the Black Paintings on the walls of his house, featuring nightmarish scenes including Saturn devouring his own son. Similarly, his Disasters of War prints - depicting decapitations, garrotting and other horrors meted out on Spanish soil during the Peninsular Wars - are some of the most unflinchingly graphic images in art history.
Neither the Black Paintings nor Disasters of War were intended for public consumption; they were private outpourings, for Goya's eyes only. They reveal a troubled genius whose dark visions have since influenced everyone from Dali and Magnum photographers to the Chapman Brothers.
He remains an enigma, an artist of incredible range, who could flatter kings and courtiers by day, yet produce some of the most haunting imagery of all time by night. How did he do it? How did he switch so capably from one mood, one mode to the other? Heaven only knows.
Goya's paintings of the three Bourbon kings survive. Interestingly, however, not one of Joseph I does. This might simply be because Goya painted relatively few portraits during that short reign. Though perhaps the truth is more tantalising: that he went to great lengths to destroy images of Joseph upon Ferdinand's return to the throne in 1814.
The latter imprisoned anyone he felt had "collaborated" with the French. Goya was ultimately pardoned by an official enquiry, though he sailed pretty close to the wind. One assumes he admired the progressive ideals enshrined by the French Revolution, plus he retained a court salary and earned a Royal Order of Spain decoration under Joseph. X-ray analysis of one of the portraits coming to the National, of magistrate Ramon Satué, reveals that it originally depicted a French general (very probably Joseph) but was later painted over.
It's tricky to pin down Goya's precise political views. He kept his cards close to his chest - his livelihood, after all, depended on painting whoever held sway at a given time. Yet, judging by one particular portrait of Ferdinand VII after his restoration, one senses the king wasn't his favourite subject.
Ferdinand was said to be dim-witted and, in his second reign, ruled with an iron fist of absolutism. Goya captures him in fine garments of ermine, yet with a bulbous nose and jutting chin - not to mention an awkward pose with his head markedly offset to the left, as if to emphasise a man of considerable twistedness.
Surely we can't take such an image at face-value. But then we suddenly find ourselves looking again at all of Goya's portraits. So adept was he in depicting the nuances of the human face, that time after time he leaves you wondering how fond - if at all - he was of his sitters. Goya had an unparalleled ability to flatter and to skewer in one and the same image.
Which brings us back to The Family of Charles IV. Charles had a reputation for not enjoying the business of kingship - it got in the way of a good hunt - and he actually ceded control of Spain to his wife and her lover, the general Manuel Godoy. Now, might we be able to see a strong hint of such dysfunction in Goya's group portrait? Look closely and aren't the royal expressions, in fact, rather awkward, crab-faced and even slightly moronic? Certainly, scores of art historians have thought so, the Frenchman Theophile Gautier comparing king and queen to the "corner baker and his wife after they'd won the lottery". I'm inclined to agree that Goya was fusing superficial flattery with subversive mockery.
If there has ever been a more riveting artist than Goya, I've yet to come across them. Privately he responded to his troubled times and soul with visions of compelling darkness. Yet, in public he remained deadpan for decades, painting the most powerful men and women in Spain with a psychological range worthy of Balzac.
Much more than mere depictions, his portraits are a fascinating high-wire act between truth and decorum, that only a master brushman like himself could pull off. Their details keep you transfixed for hours, searching for where exactly Goya's real sentiments lay.