diff --git a/extensions/phal/create_pel.cpp b/extensions/phal/create_pel.cpp
index 14d796d..c10f32c 100644
--- a/extensions/phal/create_pel.cpp
+++ b/extensions/phal/create_pel.cpp
@@ -86,6 +86,64 @@
     }
 }
 
+void createSbeErrorPEL(const std::string& event, const sbeError_t& sbeError,
+                       const FFDCData& ffdcData)
+{
+    std::map<std::string, std::string> additionalData;
+    auto bus = sdbusplus::bus::new_default();
+
+    additionalData.emplace("_PID", std::to_string(getpid()));
+    additionalData.emplace("SBE_ERR_MSG", sbeError.what());
+
+    for (auto& data : ffdcData)
+    {
+        additionalData.emplace(data);
+    }
+
+    std::vector<std::tuple<
+        sdbusplus::xyz::openbmc_project::Logging::server::Create::FFDCFormat,
+        uint8_t, uint8_t, sdbusplus::message::unix_fd>>
+        pelFFDCInfo;
+
+    // Refer phosphor-logging/extensions/openpower-pels/README.md section
+    // "Self Boot Engine(SBE) First Failure Data Capture(FFDC) Support"
+    // for details of related to createPEL with SBE FFDC information
+    // usin g CreateWithFFDCFiles api.
+    pelFFDCInfo.push_back(
+        std::make_tuple(sdbusplus::xyz::openbmc_project::Logging::server::
+                            Create::FFDCFormat::Custom,
+                        static_cast<uint8_t>(0xCB), static_cast<uint8_t>(0x01),
+                        sbeError.getFd()));
+    try
+    {
+        std::string service =
+            util::getService(bus, loggingObjectPath, loggingInterface);
+        auto method =
+            bus.new_method_call(service.c_str(), loggingObjectPath,
+                                loggingInterface, "CreateWithFFDCFiles");
+        auto level =
+            sdbusplus::xyz::openbmc_project::Logging::server::convertForMessage(
+                sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level::
+                    Error);
+        method.append(event, level, additionalData, pelFFDCInfo);
+        auto resp = bus.call(method);
+    }
+    catch (const sdbusplus::exception::exception& e)
+    {
+        log<level::ERR>(fmt::format("D-Bus call exception",
+                                    "OBJPATH={}, INTERFACE={}, EXCEPTION={}",
+                                    loggingObjectPath, loggingInterface,
+                                    e.what())
+                            .c_str());
+        throw std::runtime_error(
+            "Error in invoking D-Bus logging create interface");
+    }
+    catch (std::exception& e)
+    {
+        throw e;
+    }
+}
+
 void createPEL(const std::string& event, const FFDCData& ffdcData)
 {
     std::map<std::string, std::string> additionalData;
