The moment we hear the Important Historical Movie score swelling up and we read the title card telling us “A United Kingdom” was inspired by true events, we know a few things.

We know this movie will almost certainly end with a freeze-frame of the two actors portraying real-life figures at the most triumphant moment of their lives — and we know that shot will dissolve to archival photos of the actual people, followed by graphics telling us what happened to them in the years and decades after the time of the movie.

We know this, because we have seen many an inspirational, based-on-true-events story about forbidden (or at least frowned-upon) romance (e.g., “Loving” from just a couple of months ago), and the majority of these films use a cinematic comfort-food recipe that simplifies events by giving us hiss-worthy villains, and turning the lead characters into near-saintly figures.

“A United Kingdom” follows the playbook from start to finish, and that very predictability had me wavering until the very end between a reluctant pass and a mild recommendation — but thanks in large part to the genuine movie-star charisma of David Oyelowo and to the breathtakingly beautiful on-location cinematography in Botswana, here we are with the arrow pointing up.

The handsome, quietly commanding Oyelowo, a versatile actor often cast in historical dramas (“Selma,” “Queen of Katwe,” “The Butler,” “Lincoln”), plays Seretse Khama, an African law student in 1947 London. We know he’s a fighter because the first time we see him, he’s literally fighting — in the boxing ring, against a white pug who calls him a racist slur and head-butts him.

One night at a church dance (the local priest invites black foreign students in the hopes of converting them), Seretse locks eyes with Ruth Williams (Rosamund Pike), a meek girl who seems to have no social life. (Put it this way: If you watched “Downton Abbey,” remember Lady Edith, the wallflower sister? In this movie, Laura Carmichael, who played Lady Edith, is the FUN sister to Pike’s dishwater-dull Ruth.)

Just in case we missed it the first time, Seretse and Ruth lock eyes again. And one more time. By the time he asks her to dance, they might as well be printing up wedding invitations.

Of course, what with this being 1947, such a courtship presents myriad issues — especially when Seretse reveals to Ruth he has to return home to his African homeland of Bechuanaland, because what do you know, he’s the heir to the throne. So when Seretse proposes to Ruth, he’s also asking her to become the white queen of an African nation with some independence but ultimately under the rule of the United Kingdom.

Further complicating matters:  Bechuanaland borders South Africa, which is on the verge of enforcing apartheid policies of strict racial segregation. The British government considers South Africa a key ally for a number of strategic and financial reasons, and the last thing it wants to do is antagonize its leaders by officially sanctioning the marriage between Seretse and Ruth.

Seretse’s family also vehemently opposes the marriage. How can Seretse return to his homeland with a white, British woman to rule by his side as the queen?

Oyelowo and Pike have solid chemistry together. Oyelowo gets the big, speechifying, showcase moments — but Pike shines in quieter scenes, whether she’s (somewhat naively) shocked by coldness and casual racism, or touched by acts of kindness from the villagers who initially rejected her.

Director Amma Asante and screenwriter Guy Hibbert provide multiple, mostly one-dimensional adversaries, including Jack Davenport as the elegantly slimy (and fictional) British civil servant who takes sadistic pleasure in punishing Ruth and Seretse at every turn, and Tom Felton (Draco Malfoy from the “Harry Potter” movies) as the sniveling, sneering Rufus Lancaster (another fictional character), the British district commissioner determined to keep Seretse exiled from his home country unless he divorces Ruth. Despite the lack of nuance in the characters as written, fine work from both actors.

David Oyelowo has done memorable work as the soldier who steps up for the president in the first scene in “Lincoln”; Freedom Rider Louis Gaines, the son of Forest Whitaker’s character in “Lee Daniels’ The Butler”; Martin Luther King in “Selma,” and the chess coach/mentor Robert Katende in “Queen of Katwe.”

He’s a great actor, and these are very good roles. But I’d love to see him as the lead in a sharp buddy comedy, or a modern romance. Of course he’s done roles other than the aforementioned historical dramas, but it would be nice to see the resume expand as it should for any actor of such talent.

★★★

Fox Searchlight presents a film directed by Amma Asante and written by Guy Hibbert. Rated PG-13 (for some language including racial epithets and a scene of sensuality). Running time: 111 minutes. Opens Friday at local theaters.