E.R. Braithwaite, the Guyanese author, educator and diplomat whose years teaching in the slums of London's East End inspired the international best-seller "To Sir, With Love" and the popular Sidney Poitier movie of the same name, has died at age 104.

Braithwaite's companion, Ginette Ast, told The Associated Press that he became ill Monday and died at the Adventist HealthCare Shady Grove Medical Center in Rockville, Maryland.

Schooled in Guyana, the U.S. and Britain, Braithwaite wrote several fiction and nonfiction books, often focusing on racism and class and the contrast between first world and colonial cultures. He was regarded as an early and overlooked chronicler of Britain from a non-white's perspective, his admirers including the authors Hanif Kureishi and Caryl Phillips.

Guyanese writer Edward Ricardo Braithwaite FPG / Getty Images

He also served in the 1960s as the newly independent Guyana's first representative at the United Nations and later was ambassador to Venezuela. Upon his 100th birthday, he received an honorary medal from his native country for lifetime achievement.

Guyana President David Granger on Tuesday remembered Braithwaite as "an eminent Guyanese and distinguished diplomat."

To Sir, With Love," his first and most famous book, was published in 1959. The autobiographical tale about how a West Indian of patrician manner scolded, encouraged and befriended a rowdy, mostly white class of East End teens, who in turn softened him, was an immediate success and a natural for film. Poitier played Braithwaite (renamed Thackeray) in the 1967 release and the pop star Lulu was featured as one of the students. The title song, performed on screen and on record by Lulu, became a No. 1 hit.

Audiences loved the movie, but critics found it too sentimental: Braithwaite agreed. He criticized director-screenwriter James Clavell for downplaying the author's interracial romance with a fellow teacher and said Poitier's performance was too light-hearted.

"The movie made it look like fun and games," he later observed.

One former student, Alfred Gardner, would allege that Braithwaite himself sanitized his life. In the self-published memoir "An East End Story," Gardner described Braithwaite as a cold and rigid man who "struck fear into us by favouring corporal punishment."

Edward Ricardo Braithwaite was born in what was then British Guiana in 1912, the son of Oxford graduates who grew up in relatively affluent surroundings and by the late 1930s was attending graduate school at Cambridge University. A pilot in Britain's Royal Air Force during World War II, he graduated from Cambridge in 1949 with a degree in physics and confidence that he was well suited for his chosen field.

But, like so many black veterans, he discovered that his background meant nothing in the civilian world. He was repeatedly turned down for jobs and housing, a deeply disillusioning experience.

"The majority of Britons at home have very little appreciation of what that intangible yet amazingly real and invaluable export — the British Way of Life — means to colonial people," he wrote in "To Sir, With Love."

"Yes, it is wonderful to be British. Until one comes to Britain."

Braithwaite was finally hired as a teacher at a secondary school in a bombed-out East End neighborhood, "hating it at first, treating it as a temporary exercise in survival until something better came along."

He taught for nine years, long enough to be addressed as "Sir" by his students. While employed at the London welfare department, helping minority children find homes, he began thinking about his classroom experiences. A London couple which had taken him in as a surrogate son urged him to write a book. Reluctant at first, he quickly completed a manuscript, writing on a collapsible bridge table under an apple tree. For the title, he remembered a package of monogrammed cigarettes his students had given him.

"On the wrapping of the box, they had stuck a piece of paper and written on it, 'To Sir, With Love,'" he later wrote.

His other books included the novel "Paid Servant," based on his time as a social worker, and "Honorary White," a report of his visit to South Africa in the 1970s. The autobiographical "Reluctant Neighbors," with a structure similar to Amiri Baraka's explosive play "Dutchman," recounts an increasingly contentious train conversation between Braithwaite and a well-meaning, but patronizing white American businessman who cannot fathom Braithwaite's despair and anger.

At various times, Braithwaite lived in Guyana, London, Paris, New York and Washington. He taught at several schools, including New York University and Howard University, was a consultant for UNESCO and lectured in Europe in 2013 on behalf of the U.S. State Department. Meanwhile, "To Sir, With Love" lived on. In 1996, Poitier reprised his famous role in "To Sir, With Love II," a television movie. A stage production of the original story toured in 2013.

"I don't know if I changed any lives or not, but something did happen between them and me, which was quite gratifying," Braithwaite said of his former students during a 2013 interview with the online publication Coffee-Table Notes, adding that he believed the book still resonated.

"It appeals to a lot of people. They each find what they're looking for. Each person is looking for something he or she could use in their daily life."